Switch
An accessible toggle switch for boolean values, perfect for settings and preferences.
Interactive Playground
Switch
Toggle the switch state
Checked:
falseProps
| Prop | Type | Default | Description |
|---|---|---|---|
checked | boolean | false | Switch state (bindable) |
size | 'sm' | 'md' | 'lg' | 'md' | Size of the switch |
disabled | boolean | false | Disable the switch |
name | string | '' | Form field name |
id | string | - | Custom ID (auto-generated if not provided) |
onchange | function | - | Change event handler |