Cranpose

Try the showcase in your browser ·
Watch live market data in Cranpose Markets
Cranpose brings the Jetpack Compose model to Rust. Composable functions describe
the UI. State changes trigger recomposition. Modifiers control layout, input and
graphics. Cranpose supplies the platform window and device services.
Use the same Rust UI on Linux, macOS, Windows, Android, Wear OS, iOS, Apple Watch
and the web.
Add Cranpose screens to an existing Android Compose or UIKit app, or place native
controls inside a Cranpose screen.
Cranpose Guide ·
Performance results ·
API reference ·
Project template ·
Releases ·
Discussions
On a Huawei Mate 20 X from 2018, the gauntlet benchmark
the Performance tab
shows the latest run, with Flutter, React Native, egui, Slint and other
frameworks on the same phone and on a Mac M3Pro both native and from browser of that platform.
Apps built with Cranpose
| App | Platforms | Get it |
|---|
| Cranamp, a music player with pixel skins and a skin editor (source) | Windows, macOS, Linux, Android, iOS, web | Google Play, App Store, Microsoft Store, AUR, browser |
| Cranslate, an offline speech translator for a phone and a watch | Android, Wear OS, iOS, Apple Watch | Google Play, App Store |
| CranScan, a document and receipt scanner with on-device text recognition | Android, iOS | Google Play, App Store |
| Orbit Breaker, a brick-breaking game for watches, steered with the crown | Wear OS, Apple Watch | Google Play, App Store |
Start an app
The Cranpose plugin for IntelliJ IDEA and RustRover
includes the project template. Choose File → New Project → Cranpose. The
plugin provides live previews, reload after source edits, a layout inspector and
recomposition hints. See the IDE guide for controls and shortcuts.
For a terminal workflow, clone the same template:
git clone https://github.com/samoylenkodmitry/cranpose-showcase.git my-app
cd my-app
cargo run --release
Replace the sample screens in src/screens, and the watch screens in src/watch.
The template places data access in src/data and view models in
src/presentation. Android and Wear OS Gradle modules, iOS and Apple Watch
scripts and a web build script share the Rust code.
Run the showcase to explore
the template's navigation, adaptive layout and Liquid components.
Write a composable
For an app with one source file, create a Cargo package:
cargo new counter
cd counter
cargo add cranpose --features desktop,renderer-wgpu
cargo add anyhow
Replace src/main.rs with:
use cranpose::prelude::*;
#[composable]
fn Counter() {
let count = rememberMutableStateOf(|| 0);