Toggle
Two-state button, wrapping Radix Toggle.
Toggle is a button that stays pressed: formatting controls, favorite
states, view switches. ToggleGroup composes several into one value.
Installation
import { Toggle } from "@iammikz/srui";
Usage
Props
| Prop | Type | Default | Description |
|---|---|---|---|
variant | "default" | "outline" | "default" | outline adds a border |
size | "sm" | "default" | "lg" | "default" | h-8 / h-9 / h-10 |
pressed / defaultPressed | boolean | — | Controlled / initial pressed state |
onPressedChange | (pressed: boolean) => void | — | Fires on toggle |
Also exports toggleStyles (the tv recipe) for custom compositions.