Switch
Toggle for settings that take effect immediately — prefer over Checkbox when there's no separate save step.
<div className="ui-w-72"> <Switch label="Require two-factor authentication" description="All members must enable 2FA to sign in." defaultChecked /> </div>
Editable — change the code above and the preview updates live.
Installation
import { Switch } from "@labanaat/ui/switch";Props
| Prop | Type | Default | Description |
|---|---|---|---|
| label | ReactNode | — | Field label |
| description | string | — | Helper text |
| checked / defaultChecked | boolean | — | Controlled / uncontrolled state |
| onCheckedChange | (checked) => void | — | Change handler |
| disabled | boolean | false | Disables interaction |