Design System

Component usage guide template

Browse Components

ui

Switch

A control that allows the user to toggle between checked and not checked.

1. Import
Import the switch component from the design system.
import { Switch } from "@/design-system/components/ui/switch"
2. Props
Switch component props.
PropTypeDefault
size'sm' | 'default''default'
checkedbooleanfalse
defaultCheckedbooleanfalse
onCheckedChange(checked: boolean) => void--
disabledbooleanfalse
labelstring | ReactNode--
requiredbooleanfalse
errorstring--
classNamestring--
3. Sizes
Available sizes for the Switch component.
4. Usages
Common switch patterns and configurations.
import { Switch } from "@/design-system/components/ui/switch";
import { Label } from "@/design-system/components/ui/label";

export function Example() {
  return (
    <Switch id="airplane-mode" label="Airplane Mode" />
  );
}