Macro ui
Source macro_rules! ui {
(vstack(gap: $gap:expr) { $($child:tt)* }) => { ... };
(vstack { $($child:tt)* }) => { ... };
(hstack(gap: $gap:expr) { $($child:tt)* }) => { ... };
(hstack { $($child:tt)* }) => { ... };
(@child vstack $($rest:tt)*) => { ... };
(@child hstack $($rest:tt)*) => { ... };
(@child $expr:expr) => { ... };
}
Expand description
Build a complete UI layout declaratively
§Examples
ⓘuse revue::prelude::*;
let ui = ui! {
vstack(gap: 1) {
Text::heading("Dashboard")
hstack {
bordered!["Stats"; Text::new("100")]
bordered!["Users"; Text::new("42")]
}
Text::muted("Press 'q' to quit")
}
};