Binary on and off toggles.
Add this item from the registry, or import it from the package after installing Default File UI.
Registry path
itsvigneshv/default-file-ui/switchPackage import
import { Switch } from "@default-file/ui/components/df-switch"Checked by default.
Small and default sizes.
Non-interactive states.
Binary on and off toggle.
| Prop | Type | Default | Notes |
|---|---|---|---|
| checked | boolean | — | Controlled checked state. |
| defaultChecked | boolean | false | Uncontrolled initial checked state. |
| onCheckedChange | (checked: boolean) => void | — | Called when the switch toggles. |
| size | "sm" | "default" | "default" | Control size. |
| disabled | boolean | — | Non-interactive switch. |
| className | string | — | Additional styles. |
| …button attributes | ButtonHTMLAttributes (minus onChange) | — | Native button props (aria-label recommended). |