-
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 fastest way to a running app is the rsc CLI, which generates a
ready-to-run project and launches it:
rsc new my-app # scaffold a new ROSACE app
cd my-app
rsc run # build and run it on the desktop
# or: rsc dev # run with hot reload (edit + see changes live)rsc run/rsc dev also take a target (e.g. --mac, --ios, --android)
— see The rsc CLI for the full command surface.
Next: Components & State — the two ideas everything else is built on.
Guide
- Overview
- Getting Started
- Components & State
- Layout & Widgets
- Interaction
- Navigation
- Theming
- Forms & Text Input
- Animation
- Persistence & Networking
- Multi-Platform & the rsc CLI
- Hot Reload
Architecture
- Overview
- Core: Component, Element, Context
- State & Reactivity
- Render Pipeline
- Widget Protocol
- Platform & the App Loop
- The rsc CLI
- Hot Reload
Reference