A native, reactive UI framework for Rust desktop applications.
CreamUI pairs a familiar component model with native windows, CSS-like flex and grid layout, JSX syntax, and a configurable application theme. It is built for apps that want a small Rust-native UI stack without embedding a web view.
Project status: early MVP. The public API is evolving; Linux is the currently supported desktop target.
- Native desktop windows through
winit, with GPU or CPU presentation. - Reactive state with small, straightforward
Signalvalues. - Headless raw widgets and polished themed widgets in the same toolkit.
- JSX syntax that compiles to ordinary Rust widget builders.
- Flex and grid layouts powered by Taffy.
- Accessible keyboard interactions for the standard controls.
- Built-in date, time, color, and native file pickers.
- PNG by default, with opt-in JPEG and WebP image decoding.
- An optional C ABI for shared runtimes and non-Rust hosts.
CreamUI includes text, buttons, text inputs, text areas, checkboxes, switches, sliders, select/list/radio controls, tabs, sidebars, scroll views, trees, tables, popovers, dialogs, progress indicators, pickers, and images.
Core controls have lower-level Raw* counterparts for manual styling. Composite themed widgets can also be customized with Styled or assembled from raw controls and layout primitives. See the component catalog for the available foundations.
Specialized widgets are opt-in crates under extras/. For example, creamui-chart
provides raw/themed charts, creamui-diff-viewer provides raw/themed patch
review, and creamui-grid-layout provides a draggable dashboard grid. Only
applications that depend on an extra compile it; the
optional component catalog lists
the available crates.
Add the runtime crates to your application:
[dependencies]
creamui = { version = "0.1", features = ["jsx"] }Then create a window and return a widget tree:
use creamui::widgets::layout::{Align, Flex, Justify};
use creamui::{run, BoxedWidget, Button, Signal, Size, Text, Theme, WindowOptions};
fn main() {
let clicks = Signal::new(0_u32);
run(
WindowOptions {
title: "Hello CreamUI".into(),
width: 480,
height: 320,
..Default::default()
},
Theme::default().surface,
|_| {},
move |viewport: Size| -> BoxedWidget {
let theme = Theme::default();
let increment = clicks.clone();
Box::new(
Flex::column()
.size(viewport.width, viewport.height)
.gap(12.0)
.justify(Justify::Center)
.align(Align::Center)
.background(theme.surface)
.child(Box::new(Text::new("Hello, CreamUI!").font_size(28.0)))
.child(Box::new(Text::new(format!("Clicked {} times", clicks.get()))))
.child(Box::new(Button::new("Click me", move || increment.update(|n| *n += 1)))),
)
},
);
}cargo run -p hello-world
cargo run -p showcase
cargo run -p pickers
cargo run -p images
cargo run -p flex
cargo run -p jsx-styles
cargo run -p trayThese examples build CPU-only by default. To include GPU rendering in an
application, enable its gpu feature; the window still starts on CPU unless
it requests RenderBackend::Gpu or the backend is overridden at launch:
CUI_OVERRIDE_RENDER_BACKEND=gpu cargo run -p hello-world --features gpuThe showcase is the fastest way to explore the available controls and theme behavior.
The tray example shows a persistent background application: closing its
window leaves the process alive, while the system tray can create it again,
update a reactive counter, or quit the process.
The same showcase can be compiled to WASM and opened in a browser:
demo/build.sh # builds every demo under demo/ to demo/<name>/pkg/
demo/serve.sh # serves demo/ statically at http://localhost:8080Open http://localhost:8080/showcase/. Its canvas fills the whole page and
takes mouse/keyboard input like a native window. See
demo/showcase for asynchronous file selection and clipboard
access, and demo/build.sh --dev for a
faster, unoptimized build while iterating.
Install the Rust target, Android SDK/NDK, and cargo-apk, then build the
NativeActivity demo:
rustup target add aarch64-linux-android
cargo install cargo-apk
cargo apk build -p creamui-android-demo --target aarch64-linux-androidANDROID_HOME and ANDROID_NDK_HOME must point at the installed SDK and NDK.
The demo runs the interactive showcase with GPU or CPU presentation, touch and
keyboard input, text clipboard access, safe-area insets, and a file path modal.
The modal accepts readable local files with matching extensions; it does not
request storage access through Android's document provider. Both presenters
release their native surfaces during suspension and recreate them on resume,
keeping reactive state and forcing a complete first frame. Android supports
one activity window: additional window and native popup requests are rejected
with a warning, and their ready callbacks do not run. Use hosted overlays for
secondary views. Closing the activity window exits by default; keep_running()
allows creating a replacement after it closes.
See file picker integration for the modal host.
See platform builds and Android signing for debug and release APK commands, secure keystore handling, and Windows desktop builds.
- Getting started
- Styling scope
- Components
- Theming
- Images
- Dynamic and C ABI usage
- Platform builds and Android signing
- Release guide
| Crate | Use it for |
|---|---|
creamui |
Main facade crate; the recommended starting point |
creamui-reactive |
Signals and reactive effects |
creamui-router |
Declarative routes, reactive hooks, browser and memory history |
creamui-theme |
Default theme, light palette, and design tokens |
creamui-core |
Widget, painter, scene, and layout abstractions |
creamui-widgets |
Raw and themed components |
creamui-image |
PNG, JPEG, and WebP image widgets |
creamui-render |
Native windows and frame presentation |
creamui-tray |
Optional native system-tray backends |
creamui-devtools |
Development-only FPS/frame-time/CPU/RAM overlay (F3) |
creamui-macros / creamui-jsx |
JSX syntax and component support |
creamui-abi, creamui-ffi, creamui-dynamic |
Optional dynamic-runtime and C ABI integration |
CreamUI is licensed under Apache-2.0. It permits commercial, private, and open-source use.
Contributions are welcome. Please read CONTRIBUTING.md before opening a pull request.