WFP logoDesign System

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

Installation

pnpm dlx shadcn@latest add https://designsystem.wfp.org/r/switch.json

Usage

import { Switch } from "@/components/ui/switch";
<Switch />

Examples

Size

Use the size prop to change the size of the switch.

API reference

Switch

PropTypeDefault
size"sm" | "default""default"

See the Radix UI Switch documentation for additional props.