Forms
Switch
Binary toggle for settings.
Sourceswitch.tsx
Primitive
@radix-ui/react-switch
Switch
Binary toggle.
API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
checked | boolean | -- | Controlled checked state. |
defaultChecked | boolean | -- | Default checked for uncontrolled usage. |
onCheckedChange | (checked: boolean) => void | -- | Called when state changes. |
disabled | boolean | false | Disable the switch. |
Usage
import { Switch } from "@doss/tetris-ui";