Switch
Immediate on/off setting. Use for instant effects, not for form submission choices (those are checkboxes).
Example
<Switch name="notifications" label="Email notifications" checked />
<Switch name="dark" label="Dark mode" />Props
| Prop | Type | Default | Description |
|---|---|---|---|
name | string | - | Form field name. |
checked | boolean | false | On state. |
label | string | - | Or use the default slot. |
Theming
:root {
--ink-switch-track-width: 2.5rem;
}Accessibility
- Input carries
role="switch"so AT announces on/off. - Focus outline renders on the track, thumb animates on toggle.