A cross-platform CSS-styled UI framework for Rust.
OpenKit provides a consistent, beautiful desktop application experience across Windows, macOS, and Linux with CSS-powered styling and a Tailwind-inspired design system.
- Cross-Platform: Native look and feel on Windows, macOS, and Linux
- CSS Styling: Style your UI with familiar CSS syntax
- GPU Accelerated: High-performance rendering with wgpu (with CPU fallback)
- Rich Widget Set: 30+ widgets for building complete desktop applications
- Tailwind-Inspired: Built-in design system with dark/light themes
- Declarative Macros: Ergonomic UI building with
col!,row!,button!, etc. - Angular-Like Components: Component system with props, state, and lifecycle hooks
Add OpenKit to your Cargo.toml:
[dependencies]
openkit = "0.1"Create a simple application:
use openkit::prelude::*;
fn main() {
App::new()
.title("My App")
.theme(Theme::Auto)
.run(|| {
col![16;
label!("Hello, OpenKit!"),
button!("Click me", { println!("Clicked!"); }),
]
});
}OpenKit includes a comprehensive widget set:
Column,Row- Flex containersCard- Content container with stylingScrollView- Scrollable containerTabs- Tabbed interfaceSpacer,Separator- Layout helpers
Button,IconButton- Clickable buttonsTextField,PasswordField- Text inputCheckbox,ToggleSwitch- Boolean inputDropdown,Slider- Selection controls
Label- Text displayAvatar- User profile imagesProgress,Spinner- Loading indicatorsNotification,Tooltip- Information display
Window- Decorated windows with OS-native controlsBar- Taskbar/panel containerDesktop- Desktop with wallpaper and iconsContextMenu- Right-click menusSystemTray,Clock- System indicatorsWorkspaceSwitcher- Virtual desktop switching
Style widgets with CSS:
use openkit::prelude::*;
fn main() {
App::new()
.load_css(r#"
.my-button {
background: linear-gradient(to-right, #667eea, #764ba2);
border-radius: 8px;
padding: 12px 24px;
}
.my-button:hover {
transform: scale(1.05);
}
"#)
.run(|| {
button!("Styled Button").class("my-button")
});
}OpenKit includes a Tailwind-inspired theme system:
use openkit::prelude::*;
fn main() {
App::new()
.theme(Theme::Dark) // or Theme::Light, Theme::Auto
.run(|| {
// Widgets automatically use theme colors
col![16;
label!("Themed UI"),
button!("Primary", Primary),
button!("Secondary", Secondary),
button!("Destructive", Destructive),
]
});
}Create desktop environments with customizable backgrounds:
use openkit::prelude::*;
let desktop = Desktop::new()
.background(Wallpaper::image("/path/to/wallpaper.jpg")
.with_mode(WallpaperMode::Fill))
.icon(DesktopIcon::new("home", "Home", "🏠").at(0, 0))
.icon(DesktopIcon::new("files", "Files", "📁").at(0, 1));Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contributions are welcome! Please feel free to submit a Pull Request.