Hextech UI

Toggle

Live example

Toggle

Installation

Terminal
npx shadcn@latest add https://hextech-ui.vercel.app/r/toggle.json

API reference

These are the main Toggle options. See the exported TypeScript types for inherited native or primitive props.

PropTypeDefault
pressed / defaultPressedboolean (Toggle)false
value / defaultValuestring[] (ToggleGroup)—
multipleboolean (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.