| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
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.
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::*;
fn Counter() -> 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)
}),
))
}
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());
// Mutable for component-local state that should always recompose
// (auto-requests a frame on set/update)
let input = remember_mutable(|| 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())));
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:
Issues and PRs are welcome, especially for:
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.
MPL-2.0 - see LICENSE.
See LICENSE for more info.
| Back | FazBrowse Home | New Git URL |