17 releases (7 breaking)
Uses new Rust 2024
| new 0.13.1 | Feb 12, 2026 |
|---|---|
| 0.12.2 | Jan 25, 2026 |
| 0.8.3 | Dec 14, 2025 |
| 0.7.1 | Nov 18, 2025 |
#1174 in GUI
335KB
9K
SLoC
Repose
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.
Features
- Declarative UI — Compose-like API with
Viewfunctions, reactiveSignals, andrememberfor state - Cross-platform — Desktop (winit), Android, and WebAssembly
- Layout — Flexbox and Grid via Taffy
- Rendering — Rectangles, borders, rounded clips, ellipses, text, images via WGPU
- Text — Shaping, metrics, and wrapping via cosmic-text with caching
- Input — Pointer events, scrolling, focus traversal, IME support
- Widgets — Text, Button, TextField, Checkbox, Switch, Slider, ScrollArea, LazyColumn
- Navigation — Typed stack navigation with transitions (
repose-navigation) - Accessibility — AccessKit integration on desktop, semantic node pipeline
- DevTools — Inspector overlay (Ctrl+Shift+I)
Non-Goals
- Full feature parity with mature toolkits (will need funding, with years of usage)
- Accessibility coverage on all platforms (in progress)
- Multi-window (native, until a better alternative to winit comes up, which wouldn't happen anytime soon) and complex popup systems
Quick Start
Prerequisites
- For desktop: system dependencies for WGPU (varies by OS)
- For web:
trunk(cargo install trunk) - For Android: Android SDK/NDK and
cargo-apk
Run the Showcase
Desktop:
cargo run -p showcase --features desktop-bin
Web:
cd examples/showcase
trunk serve
Or try the hosted demo.
Android:
cd examples/showcase
cargo rapk run --target aarch64-linux-android --lib
Usage
use repose_core::prelude::*;
use repose_ui::*;
fn Counter() -> View {
let count = remember_state(|| 0);
Column(Modifier::new().padding(16.0)).child((
Text(format!("Count: {}", *count.borrow())),
Button("Increment", {
let count = count.clone();
move || *count.borrow_mut() += 1
}),
))
}
fn main() -> anyhow::Result<()> {
repose_platform::run_desktop_app(|_sched, _ctx| Counter())
}
State management:
// Signal for shared/global state
let theme = signal(Theme::default());
theme.set(Theme::dark());
// remember_state for component-local state
let input = remember_state(|| String::new());
// Derived state
let 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())));
GIF
Inspiration
Wanted an UI which was short and easy to understand by looking at the code (essentially declaritive, helps balance out rust ig :), similar to Compose, and liked the design of Jetpack Compose too (like Iced, which was, similarly, based on elm-ui)
Architecture
| Crate | Purpose |
|---|---|
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 web) |
repose-text |
Text shaping, metrics, wrapping/ellipsis caches |
repose-material |
Material Design-inspired components |
repose-navigation |
Typed stack navigation with transitions |
repose-canvas |
Custom painting surface |
repose-devtools |
Inspector HUD |
repose-docking |
Dockable panels |
Projects Using Repose
These were built to test the toolkit in real apps:
- startpose — Web startpage
- wifi-exporter — Android WiFi importer/exporter
- soredowe — Linux pacman UI
Contributing
Issues and PRs are welcome, especially for:
- Correctness bugs
- Performance regressions (include a repro)
- Platform gaps (except external issues like Android IME, if documented)
Development Setup
git clone https://github.com/mlm-games/repose
cd repose
cargo test --workspace
Support
Consider donating if you'd like to support it's development. Open an issue or a discussions for bugs or questions.
For commercial licensing (LGPL-2.1 is the default), open an issue to discuss.
Mentions
- Taffy for layout
- cosmic-text for text shaping
- wgpu for cross-platform graphics
- AccessKit for accessibility
- Heavily inspired by Jetpack Compose's API design
License
See LICENSE.
Dependencies
~26MB
~285K SLoC