Switch
The Switch component is a form control that allows users to toggle between two states. It provides a visual representation of a boolean value and can be customized with labels and different styles.
Props
| Name | Default | Type |
|---|---|---|
modelValue | — | boolean The current state of the switch |
label | — | string The label text for the switch |
disabled | false | boolean Whether the switch is disabled |
accent | false | boolean Whether to use the accent color |
reversed | false | boolean Reverses the switch and label positions |
hint | — | string Helper text displayed below the switch |
Events
| Name | Payload | Description |
|---|---|---|
update:modelValue | boolean | Emitted when the switch state changes |
Slots
| Name | Accepts | Description |
|---|---|---|
default | any | Content to be displayed as the label (overrides the label prop if provided) |