Switch

Binary on and off toggles.

Installation

Add this item from the registry, or import it from the package after installing Default File UI.

Registry path

itsvigneshv/default-file-ui/switch

Package import

import { Switch } from "@default-file/ui/components/df-switch"

Default

Checked by default.

Sizes

Small and default sizes.

Disabled

Non-interactive states.

Properties

Binary on and off toggle.

Switch

PropTypeDefaultNotes
checkedbooleanControlled checked state.
defaultCheckedbooleanfalseUncontrolled initial checked state.
onCheckedChange(checked: boolean) => voidCalled when the switch toggles.
size"sm" | "default""default"Control size.
disabledbooleanNon-interactive switch.
classNamestringAdditional styles.
…button attributesButtonHTMLAttributes (minus onChange)Native button props (aria-label recommended).