Components
Documentation contentSwitch
Use switch for a boolean setting. Provide a label as element content, bind checked to the model, and handle on-toggle. It uses the same state contract as checkbox with a sliding thumb.
switch

Markup
Programmatic construction (Zig)
In a Zig view, the canvas.Ui builder constructs the same tree programmatically — the widget kind is .switch_control:
Attributes
| Attribute | Description |
|---|---|
text | Text value for text-bearing elements; a literal or one {binding}. |
checked | Checked state for checkbox/toggle; true/false or a {binding}. |
disabled | Disables the control; true/false or a {binding}. |
on-toggle | Dispatch a Msg on toggle: tag or tag:{payload}. Hit-target elements only (checkbox, toggle, toggle-button, switch, accordion, ...). |
