pub enum NodeKind<Msg> {
Container {
children: Vec<UITree<Msg>>,
},
Heading {
level: u8,
text: String,
},
Text {
text: String,
},
Button {
label: String,
},
Input {
value: String,
},
Textarea {
value: String,
},
Checkbox {
label: String,
checked: bool,
},
Select {
options: Vec<(String, String)>,
selected: String,
},
Radio {
name: String,
options: Vec<(String, String)>,
selected: String,
},
List {
items: Vec<UITree<Msg>>,
},
DataGrid {
columns: Vec<String>,
rows: Vec<Vec<String>>,
},
Portal {
target: String,
content: Box<UITree<Msg>>,
},
}Variants§
Container
Heading
Text
Button
Input
Textarea
Multi-line text input.
Checkbox
A single boolean toggle, e.g. <input type="checkbox">. Two-way bound
via NodeMeta::on_toggle rather than NodeMeta::on_input since its
value is a bool, not a String.
Select
A single-choice dropdown. options is (value, label) pairs;
selected is the currently-chosen option’s value. Two-way bound via
NodeMeta::on_input (the new selected value).
Radio
A single-choice radio button group. name groups the individual radio
inputs so selecting one clears the others — required by HTML’s radio
semantics and mirrored by non-DOM backends for consistency. options
is (value, label) pairs; selected is the currently-chosen value.
Two-way bound via NodeMeta::on_input.
List
DataGrid
Portal
A “portal”: its content is rendered not inline at this node’s position
but into the named portal target instead. Hosts (DOM/canvas/TUI)
render portal targets as overlay layers (modal/toast/tooltip surfaces)
regardless of where in the logical tree the portal was declared. See
UITree::collect_portals and ContainerBuilder::portal. Backend-
agnostic: a backend that doesn’t support portal targets can simply
inline content at the declaration site as a fallback.