A toggle control for switching between two states.
import { Switch } from "@/components/ui/switch" export function SwitchDemo() { return <Switch /> }
npx shadcn@latest add https://9ui.dev/r/switch
import { Switch } from "@/components/ui/switch"
<Switch />
import { Label } from "@/components/ui/label" import { Switch } from "@/components/ui/switch" export function SwitchWithLabel() { return ( <div className="flex items-center gap-2"> <Switch id="enable-notifications" /> <Label htmlFor="enable-notifications">Enable notifications</Label> </div> ) }
import { Switch } from "@/components/ui/switch" export function SwitchDisabled() { return <Switch disabled /> }