pub struct Node {Show 17 fields
pub style: Style,
pub text: Option<TextContent>,
pub image: Option<ImageContent>,
pub tick: Option<Rgba>,
pub children: Vec<Node>,
pub on_tap: Option<String>,
pub model: Option<String>,
pub multiline: bool,
pub options: Option<Vec<String>>,
pub hidden: bool,
pub id: Option<String>,
pub label_for: Option<String>,
pub focus_model: Option<String>,
pub state_path: Option<Vec<usize>>,
pub access: Access,
pub instance: Option<String>,
pub key: Option<String>,
}Expand description
A node in the view tree: a style, optional text, children, and an optional
@tap handler (raw handler source, run by the shell on tap).
Fields§
§style: Style§text: Option<TextContent>§image: Option<ImageContent><image src=…>.
tick: Option<Rgba>A checkmark stroked to fill this box, in the given colour. Drawn as a path rather than a font glyph, since ✓ is whatever the system font happens to ship, which is not a control mark.
children: Vec<Node>§on_tap: Option<String>§model: Option<String>r-model signal name for <input> nodes (focus target + edit binding).
multiline: booltype="textarea": a multi-line text input, Enter inserts a newline.
options: Option<Vec<String>>type="select": the bound :options, so the shell can open a dropdown.
r-show="false": laid out (space reserved) but not painted.
id: Option<String>id="…": a stable identifier a label’s for= can target.
label_for: Option<String>for="…" on a label, the id of the input it labels. Resolved at build
time (the label inherits its target’s @tap), so tapping the label toggles
the target the same way tapping the target would.
focus_model: Option<String>A label whose for= targets a text input: the target input’s r-model.
The layout emits a FocusRegion here so tapping the label focuses that input
(the caret lands in the input itself, matched by model).
state_path: Option<Vec<usize>>This node’s tree path, set only when some :hover/:active rule could
match it. The layout emits a StateRegion for such nodes so the shell can
tell what the pointer is over and hand the path back as interaction state.
None: the common case, costs nothing.
access: AccessWhat this element is, for assistive technology.
instance: Option<String>Which component instance this node belongs to, when it is inside one.
A component’s own state is private to the instance, so a handler written
in a component has to say which instance it is running in: two <panel>
elements are two separate sets of state, and the handler text is
identical in both.
key: Option<String>r-key on an r-for row: which item this node stands for, rather than
which slot it happens to occupy.
Without it a list is identified by position, so reordering the data moves every row’s identity by one and anything attached to a row (the caret, most visibly) stays behind with the slot. The runtime uses this to follow a row across a reorder. Layout itself ignores it.