Toggle group
Toggles joined as a Button group, pressed one at a time or several at once, with one highlight that glides between them.
npx shadcn add https://kinoui.com/r/toggle-group.jsonCopy install command
Examples
One at a time
The default: pressing one releases the other. To keep one always pressed, as a view must be, ignore the empty value pressing the pressed one sends.
Several at once
multiple lets any number be pressed. An icon size makes the items square; name each one with aria-label.
Controlled
Own the value to set it from elsewhere, such as a button that clears every filter.
Vertical
orientation="vertical" stacks the items, with their labels along the start edge.
Installation
Copy code
npx shadcn@latest add https://kinoui.com/r/toggle-group.json- Files
lib/refs.tslib/reduce-motion.tslib/resize.tslib/swap.tsxcomponents/kino/spinner.tsxcomponents/kino/button.tsxcomponents/kino/toggle.tsxlib/run-progress.tslib/highlight.tscomponents/kino/button-group.tsxcomponents/kino/toggle-group.tsx- Packages
@base-ui/reactclass-variance-authority- Global CSS
- the feels, the density tokens, the shape tokens and the success and warning colours
New to Kino? Installation covers what your project needs first and the @kino namespace.
API reference
ToggleGroup
ToggleGroupItem
Data attributes
Accessibility
- The group has
role="group": name it witharia-label. Each item is a<button>witharia-pressed. - Tab reaches the group once; the arrow keys move between items, and Space or Enter presses one.
- The gliding highlight is decoration: it never takes the pointer, and touch doesn’t show it. With less motion asked for, it moves straight to the next item.
- Pressed is shown by a fill and by the label’s colour; in forced colours the fill takes the system’s highlight.