macro_rules! ui {
( $widget:expr => { $( $child:tt )* } ) => { ... };
( $widget:expr ) => { ... };
}Expand description
Declarative UI macro for building widget trees.
§Syntax
ⓘ
ui! {
Container::new() => {
Flex::row(12.0) => { btn_a, btn_b },
label,
}
}widget => { children... }— container with childrenwidget— leaf node (no children), automatically wrapped- Children can be bare widgets or nested
container => { ... }expressions ui!(widget)still works for explicit leaf wrapping