Switch
A toggle switch for boolean values, rendered as an accessible button with role="switch".
Installation
npx dafink-ui add switchDemo
Receive updates about your account.
Props
| Name | Type | Default | Description |
|---|---|---|---|
| checked | boolean | - | Controlled checked state. |
| onCheckedChange | (checked: boolean) => void | - | Callback fired when the switch is toggled. |
| label | string | - | Visible label rendered beside the switch. |
| hint | string | - | Helper text rendered below the label. |
| disabled | boolean | false | Disables the switch. |
| id | string | auto | HTML id for the switch button; auto-derived from label if omitted. |