A small, composable UI toolkit in Rust with a Compose-like API, cross-platform runners (desktop/Android/web), and a WGPU renderer.
Status: pre-1.0. API (mostly minor) might change. A few working apps exist, and there shouldn't be any major issues.
Useful for simple apps (though aiming for bigger ones in the future), and for developers who want a Compose-like experience in Rust without the overhead of embedding a web view or maintaining separate native UI codebases.
- Declarative composition -
Viewfunctions, reactiveSignals,remember/remember_mutable, derived state (produce_state), effects, and composition locals - Cross-platform runners - Desktop (winit), Android (native activity), WebAssembly (canvas + WGPU/WebGL)
- Layout - Flexbox and Grid via Taffy; modifiers for padding, gaps, alignment, clipping, borders, etc.
- GPU rendering - Rectangles, rounded clips, borders, ellipses, text, and images through a WGPU backend (atlases + pipelines)
- Text - Shaping, metrics, wrapping/ellipsis with caching (
repose-text/ Parley + font stack) - Input - Pointer events, scrolling, focus traversal, IME, gestures
- Widgets & building blocks - Text, buttons, text fields, checkbox, switch, slider,
ScrollArea,LazyColumn/ lazy lists, pager, overlays & snackbars, color picker, selection, subcompose - Material-inspired components - Material 3-style controls, ripples, symbols/icons (
repose-material) - Navigation - Typed back-stack navigation with transitions (
repose-navigation) - Canvas - Custom painting surface (
repose-canvas) - Docking - Dockable panels (
repose-docking) - Accessibility - AccessKit on desktop + semantic node pipeline
- DevTools - Inspector overlay (Ctrl+Shift+I)
- Animation - Runtime animation clock and helpers
- Full feature parity with mature toolkits (prioritising having a minimal and maintainable toolkit, that should work for 80% of the tasks, until i get enough funding, or after years of usage)
- For desktop: system dependencies for WGPU (varies by OS)
- For web:
trunk(cargo install trunk) - For Android: Android SDK/NDK and
cargo-apk
Desktop:
cargo run -p showcase --features desktop-binWeb:
cd examples/showcase
trunk serveOr try the hosted demo.
Android:
cd examples/showcase
cargo rapk run --target aarch64-linux-android --libuse repose_core::prelude::*;use repose_ui::*;fnCounter() -> View{let count = remember_mutable(|| 0);Column(Modifier::new().padding(16.0)).child((Text(format!("Count: {}",*count.get())),Button("Increment",{let count = count.clone();move || count.update(|c| *c += 1)}),))}fnmain() -> anyhow::Result<()>{
repose_platform::run_desktop_app(|_sched, _ctx| Counter())}State management:
// Signal for shared/global statelet theme = signal(Theme::default());
theme.set(Theme::dark());// Mutable for component-local state that should always recompose// (auto-requests a frame on set/update)let input = remember_mutable(|| String::new());// Derived statelet full_name = produce_state("full",{let first = first_name.clone();let last = last_name.clone();move || format!("{} {}", first.get(), last.get())});Layout:
Row(Modifier::new().gap(8.0)).child((Text("Left"),Spacer(),Text("Right"),))Navigation:
let stack = remember_back_stack(Route::Home);let navigator = Navigator{stack:(*stack).clone()};// Push route
navigator.push(Route::Details);// Pop (back button)
back::set(Some(Rc::new(move || navigator.pop())));
Wanted an UI which was short and easy to understand by looking at the code (essentially declaritive, helps balance out rust ig :), while being similar to Compose, (since i personally like the design of Jetpack Compose. Similar to Iced, which was also based on elm-ui)
| Crate | Role |
|---|---|
repose-core | Signals, effects, runtime, view model, locals, animation |
repose-ui | Widgets, layout (Taffy), paint, hit regions, semantics |
repose-render-wgpu | WGPU renderer, atlases, pipelines |
repose-platform | Platform runners (winit desktop / Android / WASM) |
repose-text | Text shaping, metrics, caches |
repose-material | Material-inspired components & symbols |
repose-navigation | Typed stack navigation + transitions |
repose-canvas | Custom drawing surface |
repose-devtools | Inspector HUD |
repose-docking | Dockable panels |
These were built to test the toolkit in real apps:
- startpose - Web startpage
- wifi-exporter - Android WiFi importer/exporter
- soredowe - Linux pacman/flathub/aur/appimage UI for install/updates
- renamite - Motion / vector animation editor (repose based editor all 3 platforms)
- my-ecosystem-template-bevy - 2D Bevy game template (uses repose-bevy for UI and inputs)
- ednitar-clap - Rust CLAP guitar effect plugin (only for the demonstration of repose-audui (baseview wrapper))
Issues and PRs are welcome, especially for:
- Correctness bugs
- Performance regressions (include a repro)
- Platform gaps (except external issues like Android IME, if documented)
git clone https://github.com/mlm-games/repose
cd repose
cargo test --workspaceConsider donating if you'd like to support it's development. Open an issue or a discussions for bugs or questions.
- Taffy for layout
- wgpu for cross-platform graphics
- AccessKit for accessibility
- Heavily inspired by Jetpack Compose's API design
MPL-2.0
See LICENSE for more info.
