25
A control that allows the user to toggle between checked and not checked.
npx neobrutal add switchimport { Switch } from "@/components/ui/switch"
import { Label } from "@/components/ui/label"<div className="flex items-center gap-2">
<Switch id="airplane-mode" />
<Label htmlFor="airplane-mode">Airplane Mode</Label>
</div>| Prop | Type | Default | Description |
|---|---|---|---|
| checked | boolean | - | The controlled checked state of the switch. |
| defaultChecked | boolean | - | The default checked state when uncontrolled. |
| onCheckedChange | (checked: boolean) => void | - | Event handler called when the checked state changes. |
| disabled | boolean | - | When true, prevents the user from interacting with the switch. |