Toggle group: Icons and labels
Put an icon before the label. Icon-only items need an aria-label.
This adds the example as components/examples/toggle-group/icons.tsx, together with the Toggle group component and the HextaUI theme tokens it needs.
pnpm dlx shadcn@latest add https://hextaui.com/r/toggle-group-icons.jsonTo add only the component, follow the Toggle group installation.
Props in this example
The Toggle group props this example sets, from the API reference.
| Prop | Type | Default |
|---|---|---|
defaultValue | string[] | – |
| Prop | Type | Default |
|---|---|---|
valueIdentifies the item in the group's value. | string | – |
Every prop is in the Toggle group API reference.
See them all, with keyboard support and accessibility notes, on the Toggle group page.
- MotionThe easing curves, durations and reduced-motion check every component animates with, plus hooks for size morphs and sliding highlights.
- ToggleA button that stays on or off, with a fill that settles in when pressed, a clear hover-to-on step and icons that can fill with the state.
- ButtonButtons in every variant and size, with a built-in loading, success and error flow that skips the spinner for fast requests.
- Button groupButtons joined into one control, with shared seams, separators, text addons, nesting and vertical stacks.