Switch
inputsA control that allows the user to toggle between checked and not checked.
Preview
Installation
npm install @launchapp/design-systemImport
import { Switch } from "@launchapp/design-system";Examples
Basic Switch
<div className="flex items-center space-x-2"> <Switch id="airplane-mode" /> <Label htmlFor="airplane-mode">Airplane Mode</Label></div>Props
| Prop | Type | Default | Description |
|---|---|---|---|
checked | boolean | — | Controlled checked state. |
defaultChecked | boolean | false | Initial checked state. |
onCheckedChange | (checked: boolean) => void | — | Callback when checked state changes. |
disabled | boolean | false | Disables the switch. |
required | boolean | — | Makes the switch required in forms. |