#[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,
},
Switch {
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,
},
}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
Switch
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.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Widget
impl<'de> Deserialize<'de> for Widget
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Widget
impl RefUnwindSafe for Widget
impl Send for Widget
impl Sync for Widget
impl Unpin for Widget
impl UnsafeUnpin for Widget
impl UnwindSafe for Widget
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more