Components
Documentation contentAccordion
Use accordion to show or hide a section of content. text supplies the header label, selected controls whether the children are visible, and pressing the header dispatches on-toggle. Store the open state in the model. The item adjusts its height when opened or closed.
accordion

Markup
Store a boolean in the model and toggle it in update:
A one-open-at-a-time group is a model decision: store the open item's id and compute each item's selected from an equality, flipping it in update.
Programmatic construction (Zig)
In a Zig view, the canvas.Ui builder constructs the same tree programmatically:
Attributes
| Attribute | Description |
|---|---|
text | Text value for text-bearing elements; a literal or one {binding}. |
selected | Selected state; often a {a == b} equality. |
on-toggle | Dispatch a Msg on toggle: tag or tag:{payload}. Hit-target elements only (checkbox, toggle, toggle-button, switch, accordion, ...). |
height | Definite height (plain number): the element is exactly this tall; content neither shrinks nor overflows it. |
