Toggle
Live example
Toggle
Installation
npx shadcn@latest add https://hextech-ui.vercel.app/r/toggle.jsonAPI reference
These are the main Toggle options. See the exported TypeScript types for inherited native or primitive props.
| Prop | Type | Default |
|---|---|---|
pressed / defaultPressed | boolean (Toggle) | false |
value / defaultValue | string[] (ToggleGroup) | — |
multiple | boolean (group) | false |
Pressed state
Use pressed and onPressedChange for a standalone controlled toggle. ToggleGroup owns selected values with value and onValueChange, or defaultValue; use multiple when more than one option may be active.