-
Notifications
You must be signed in to change notification settings - Fork 0
Guide Getting Started
By the end of this chapter you'll have a ROSACE app running in a window.
- Rust (stable) — install via rustup.
- For web/mobile later: the
wasm32-unknown-unknowntarget, Xcode (iOS), or the Android SDK/NDK. Not needed for desktop.
ROSACE ships a developer CLI, rsc, that wraps cargo and adds the app-framework workflow: scaffolding, a dev loop with hot reload, and multi-platform build/run. Install it from the repo:
# from the ROSACE repo root
cargo install --path rosace-cli
rsc --helprsc uses cargo under the hood for desktop; it adds the toolchains for web (wasm), iOS (xcodebuild), and Android (gradle) on top. Run rsc doctor to check your toolchain, and rsc devices to list simulators/devices.
Create a new app:
rsc new my-app
cd my-appThen run it:
rsc dev # dev mode: runs the app with hot reload on
# or
rsc run # build + run once (release-style, no hot reload)rsc dev builds and launches the app, watches your src/, and hot-reloads view! changes live (see the Hot Reload chapter). rsc run just builds and runs.
Every ROSACE app is a Component you hand to App::launch:
use rosace::prelude::*;
struct App0;
impl Component for App0 {
fn build(&self, _ctx: &mut Context) -> Element {
Scaffold::new(
Column::new()
.padding(EdgeInsets::all(24.0))
.child(Text::new("It works!")),
)
.into_element()
}
}
fn main() {
App::new().title("My App").size(480, 320).launch(App0);
}-
impl Componentwith abuildmethod is the whole contract — you return the UI as anElementtree. -
Scaffoldgives you the standard screen frame (optional app bar, body, etc.). -
Columnstacks children vertically;Textrenders text;.into_element()turns a widget into theElementthe framework expects. -
App::new()...launch(...)opens the window and starts the frame loop.
The repo ships runnable examples you can learn from:
cargo run -p rosace-examples --bin widget_gallery
cargo run -p rosace-examples --bin markdown_editor_demoNext: Components & State — the two ideas everything else is built on.