Iced Modern Inspired Theme
A comprehensive Modern-inspired theme for Iced, the cross-platform GUI library for Rust.
Features
- Complete set of Modern like system colors for both light and dark modes
- Styled components matching Modern's design language:
- Buttons (primary, secondary, tinted, etc.)
- Text inputs (standard, search, inline)
- Containers (card, sheet, sidebar, etc.)
- Form controls (checkbox, radio, pick list)
- Text styles with semantic variations
- Ready-to-use theme that can be applied to any Iced application
- Automatic light/dark mode support
Installation
Add this to your Cargo.toml:
[]
= "0.13.1"
= "0.7.5"
Quick Start
use ;
use Modern;
Examples
Button Styles
use Button;
use Modern;
// Primary button (blue filled)
new
.style;
// Secondary button (outlined)
new
.style;
// Success button (green)
new
.style;
// Warning button (orange/yellow)
new
.style;
// Danger button (red)
new
.style;
// Tinted button (semi-transparent colored background)
new
.style;
Container Styles
use Container;
use Modern;
// Card container (with shadow and rounded corners)
new
.style;
// Sheet container (modal-like appearance)
new
.style;
// Floating container (elevated with shadow)
new
.style;
Text Input Styles
use TextInput;
use Modern;
// Standard text input
new
.style;
// Search input with rounded corners
new
.style;
// Inline text input with bottom border only
new
.style;
Text Styles
use Text;
use Modern;
// Primary text (main content)
new
.style;
// Secondary text (supporting information)
new
.style;
// Colored text
new
.style;
new
.style;
Showcase Example
Check out the showcase example to see all available styles and components:
Light and Dark Mode
The theme automatically adapts to light and dark mode. You can explicitly set the mode:
// Light mode
let light_theme = light_theme;
// Dark mode
let dark_theme = dark_theme;
Available Colors
The theme includes all standard Modern system colors:
- Primary Colors: Red, Orange, Yellow, Green, Mint, Teal, Cyan, Blue, Indigo, Purple, Pink, Brown
- Gray Scale: Multiple levels of gray for UI elements
- Semantic Colors: For text, backgrounds, borders, etc.
Each color has appropriate light and dark mode variants that are automatically selected based on the current theme.
Custom Components
You can create custom components using the Modern styling functions:
// Custom button style
let my_custom_button = button
.style
.padding;
// Custom container
let my_custom_panel = container
.style
.padding
.width;
Credits
This theme is inspired by modern design principles similar to those used in various contemporary operating systems and applications. It is not affiliated with or endorsed by Apple Inc. or any other company.
License
This project is licensed under the MIT License - see the LICENSE file for details.