Switch
Form
On/off toggle bound to a boolean state.
Switch(bind: …, checked: …, label: …)
Example
state notify = true
Switch(bind: notify, label: "Email me about replies")
Renders with the class wf-switch, stable across releases, so a stylesheet may target it.
| Prop | Type | Meaning |
|---|---|---|
| bind: | State |
State variable the control reads and writes (two-way) |
| checked: | Bool |
Whether it is checked, when its state is not bound |
| label: | String |
Visible label; also the control's accessible name |
| disabled: | Bool |
Whether the control is inert |
Attribute families: global, aria, data, input. Plus the universal props on every element: animate:, exit:, speed:, class:, ref:.