OpenKit
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.
Supported Platforms
| 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 |
Features
- Cross-Platform: Native look and feel on Windows, macOS, Linux, and FreeBSD
- 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
Quick Start
Add OpenKit to your Cargo.toml:
[]
= "0.1"
Create a simple application:
use *;
Widgets
OpenKit includes a comprehensive widget set:
Layout
Column,Row- Flex containersCard- Content container with stylingScrollView- Scrollable containerTabs- Tabbed interfaceSpacer,Separator- Layout helpers
Input
Button,IconButton- Clickable buttonsTextField,PasswordField- Text inputCheckbox,ToggleSwitch- Boolean inputDropdown,Slider- Selection controls
Display
Label- Text displayAvatar- User profile imagesProgress,Spinner- Loading indicatorsNotification,Tooltip- Information display
Desktop Shell
Window- Decorated windows with OS-native controlsBar- Taskbar/panel containerDesktop- Desktop with wallpaper and iconsContextMenu- Right-click menusSystemTray,Clock- System indicatorsWorkspaceSwitcher- Virtual desktop switching
Styling
Style widgets with CSS:
use *;
Theming
OpenKit includes a Tailwind-inspired theme system:
use *;
Desktop Wallpapers
Create desktop environments with customizable backgrounds:
use *;
let desktop = new
.background
.icon
.icon;
Rendering Model
OpenKit renders its own chrome - all window decorations, widgets, and UI elements are rendered by OpenKit itself using GPU acceleration. This ensures:
- Pixel-perfect consistency across all platforms
- Full CSS control over every visual element
- No platform UI dependencies - just winit for windowing and wgpu for rendering
┌─────────────────────────────────────────────────────────┐
│ 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) │
└────────────┴────────────┴─────────────┴─────────────────┘
Platform Detection
Each platform has detection utilities (no external UI libraries required):
- Windows: Version detection, theme preference
- macOS: Version detection, theme preference
- Linux: Display server (X11/Wayland), desktop environment (GNOME, KDE, etc.)
- FreeBSD: Desktop environment detection
Feature Flags
[]
= { = "0.1", = ["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) | ❌ |
License
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.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.