◇
Switch
1 partsAnatomy
Import the parts and compose them. Each part forwards attributes to its underlying element.
vue
import {
Switch,
} from '@robonen/primitives/switch';
<Switch />API Reference
Switch
Root| Prop | Type | Description |
|---|---|---|
truthy? | T | Value representing the "on" state. Defaults to `true`. |
falsy? | T | Value representing the "off" state. Defaults to `false`. |
defaultValue? | T | Initial uncontrolled value. Defaults to `falsy`. |
disabled? | boolean | — |
required? | boolean | — |
name? | string | Name for the hidden form input. If provided, a hidden input mirrors state. |