Y2K UI

Switch

A flat toggle — pastel mint track when on, white when off, with a lemon knob that has a thick navy border.

switch-demo.app

Installation

terminal.sh
npx y2kui@latest add switch

Usage

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

Props

PropTypeDefaultDescription
checkedbooleanControlled checked state.
defaultCheckedbooleanInitial checked state (uncontrolled).
onCheckedChange(checked: boolean) => voidFired when the switch state changes.
disabledbooleanfalseDisable the switch.

On this page