#[repr(C)]pub enum Widget {
Show 20 variants
Text {
content: String,
style: TextStyle,
},
Image {
source: String,
shape: ImageShape,
ratio: ImageRatio,
},
Badge {
label: String,
tone: Tone,
},
ColorDot {
color: ProjectColor,
},
Divider,
Spacer {
size: Spacing,
},
Row {
children: Vec<Widget>,
},
Column {
children: Vec<Widget>,
},
Card {
child: Box<Widget>,
style: CardStyle,
on_press: Option<ActionToken>,
},
Box {
children: Vec<Widget>,
align: BoxAlign,
scrim: bool,
},
Grid {
children: Vec<Widget>,
},
Button {
label: String,
style: ButtonStyle,
on_press: ActionToken,
},
IconButton {
icon: Icon,
on_press: ActionToken,
},
Chip {
label: String,
selected: bool,
on_press: ActionToken,
},
TextField {
id: String,
placeholder: String,
value: String,
},
Toggle {
id: String,
label: String,
value: bool,
},
Checkbox {
id: String,
label: String,
value: bool,
},
Slider {
id: String,
value: i32,
max: i32,
},
Stepper {
value: i32,
on_decrement: ActionToken,
on_increment: ActionToken,
},
Scaffold {
title: String,
body: Box<Widget>,
tabs: Vec<Tab>,
back: Option<ActionToken>,
dark_mode: bool,
route: String,
depth: u32,
},
}Expand description
The app-agnostic widget tree the shell renders. Fixed across all apps.
Variants§
Text
Image
Badge
ColorDot
Small non-interactive colored dot — a project/identity hint.
Fields
color: ProjectColorDivider
Spacer
Row
Column
Card
Card; tappable when on_press is set.
Box
Z-stack: children layered back-to-front, positioned by align. With
scrim, the first child is a background image, darkened for legibility,
and the rest render on top in light content.
Grid
Fixed 2-column grid; children flow left-to-right, top-to-bottom.
Button
IconButton
Chip
TextField
Toggle
Checkbox
Slider
Continuous 0..=max slider; emits Input { id, Int }.
Stepper
Numeric stepper with −/+ controls carrying their own events.
Scaffold
App shell: a top bar (title + optional back), a scrollable body,
and bottom-nav tabs. dark_mode is theme-as-data — the shell themes
the whole app from it.
route + depth drive navigation: the shell animates the body when
route (the current screen’s identity) changes — slide for push/pop
(direction from whether depth grew or shrank), crossfade for a lateral
move at the same depth — and wires the system back button to back.