Toggle
A Y2K-styled toggle button with thick navy outline, lemon active state with shadow offset, and toggle group support.
toggle-demo.app
Installation
terminal.sh
npx y2kui@latest add toggleUsage
import { Toggle, ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle"Toggle Props
| Prop | Type | Default | Description |
|---|---|---|---|
pressed | boolean | — | Controlled pressed state. |
onPressedChange | (pressed: boolean) => void | — | Callback when toggle is clicked. |
variant | 'default' | 'outline' | 'pink' | 'blue' | 'mint' | 'lemon' | — | Visual variant. |
size | 'sm' | 'md' | 'lg' | — | Button size. |
Toggle Group Props
| Prop | Type | Default | Description |
|---|---|---|---|
type | 'single' | 'multiple' | — | Whether one or multiple items can be active. |
value | string | string[] | — | Controlled value. |
defaultValue | string | string[] | — | Initial value (uncontrolled). |
onValueChange | (value: string | string[]) => void | — | Callback when value changes. |