Switch
An on/off toggle built on a native checkbox, so keyboard and form behaviour come for free. The knob slides on an ease-out curve.
Examples
Basic
Show code
<Switch label="Notifications" bind:checked={on} />Disabled
Show code
<Switch label="Notifications" disabled />Props
| Prop | Type | Default | Description |
|---|---|---|---|
checked | boolean | false | On/off state. Bind it with bind:checked. |
label | string | — | Visible label text beside the switch. |
Any other attribute is spread onto the underlying checkbox input.