The Toggle is a button with a pressed state, ideal for toolbar actions like bold or italic.
Preview
Usage
Installation
$ npx shadcn@latest add https://spark-ui-olive.vercel.app/r/toggle.json
Properties
| Prop | Type | Default | Description |
|---|---|---|---|
variant | "default" | "outline" | "default" | Visual style of the toggle. |
size | "sm" | "default" | "lg" | "default" | Size of the toggle. |
pressed | boolean | — | Controlled pressed state. |
onPressedChange | (pressed: boolean) => void | — | Called when the pressed state changes. |
className | string | — | Additional CSS classes. |