UIComponentsReact
Toggles that work as one control, with one or several pressed.
Built on the headless Toggle Group.See its API in Docs
Rendered by React 19.3.1
Installation
npx shadcn@4.23.0 add https://hamur.dev/r/react/toggle-group.jsonIt also adds utils, toggle. The app needs its setup first: Installation.
Usage
Each ToggleGroupItem has a value; the group's variant and size reach every item. Set multiple to let several be pressed. Arrow keys follow orientation.
import { ToggleGroup, ToggleGroupItem } from '@/components/ui/toggle-group'Examples
API reference
The styled parts pass every prop to the headless part they wrap and add classes. The props, data attributes and keyboard are on Toggle Group's API reference.