| Crates.io | openkit |
| lib.rs | openkit |
| version | 0.1.3 |
| created_at | 2025-12-31 05:29:00.526906+00 |
| updated_at | 2026-01-02 14:22:34.988211+00 |
| description | A cross-platform CSS-styled UI framework for Rust |
| homepage | https://github.com/pegasusheavy/openkit |
| repository | https://github.com/pegasusheavy/openkit |
| max_upload_size | |
| id | 2013948 |
| size | 1,106,596 |
A cross-platform CSS-styled UI framework for Rust.
OpenKit provides a consistent, beautiful desktop application experience across Windows, macOS, Linux, and FreeBSD with CSS-powered styling and a Tailwind-inspired design system.
| Platform | Backend | GPU API | Status |
|---|---|---|---|
| Windows 10+ | Win32 | Direct3D 12 / Vulkan | ✅ Fully Supported |
| macOS 10.15+ | Cocoa | Metal | ✅ Fully Supported |
| Linux | X11 / Wayland | Vulkan / OpenGL | ✅ Fully Supported |
| FreeBSD | X11 | Vulkan / OpenGL | ✅ Fully Supported |
col!, row!, button!, etc.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 helpersButton, IconButton - Clickable buttonsTextField, PasswordField - Text inputCheckbox, ToggleSwitch - Boolean inputDropdown, Slider - Selection controlsLabel - Text displayAvatar - User profile imagesProgress, Spinner - Loading indicatorsNotification, Tooltip - Information displayWindow - Decorated windows with OS-native controlsBar - Taskbar/panel containerDesktop - Desktop with wallpaper and iconsContextMenu - Right-click menusSystemTray, Clock - System indicatorsWorkspaceSwitcher - Virtual desktop switchingStyle 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));
OpenKit renders its own chrome - all window decorations, widgets, and UI elements are rendered by OpenKit itself using GPU acceleration. This ensures:
┌─────────────────────────────────────────────────────────┐
│ Your Application │
├─────────────────────────────────────────────────────────┤
│ OpenKit Widgets │
│ (Button, Label, TextField, Window, Desktop, etc.) │
├─────────────────────────────────────────────────────────┤
│ OpenKit Renderer │
│ wgpu (GPU) │ tiny-skia (CPU fallback) │
├─────────────────────────────────────────────────────────┤
│ winit │
│ (Platform window creation) │
├────────────┬────────────┬─────────────┬─────────────────┤
│ Windows │ macOS │ Linux │ FreeBSD │
│ (Win32) │ (Cocoa) │ (X11/Wayland)│ (X11) │
└────────────┴────────────┴─────────────┴─────────────────┘
Each platform has detection utilities (no external UI libraries required):
[dependencies]
openkit = { version = "0.1", features = ["gpu", "macros"] }
| Feature | Description | Default |
|---|---|---|
gpu |
GPU-accelerated rendering via wgpu | ✅ |
macros |
Declarative UI macros (col!, button!, etc.) |
✅ |
wayland |
Wayland support (Linux) | ✅ |
x11 |
X11 support (Linux/FreeBSD) | ✅ |
hdr |
HDR support (when available) | ❌ |
Licensed under either of:
at your option.
Contributions are welcome! Please feel free to submit a Pull Request.