Skip to content
RivetUI

Toggle Group

Groups related two-state controls into a compact single- or multi-selection interface.

@rivetui/toggle-group

Preview

Explore each composition interactively, then open its code in the same context.

Single selection

Use one pressed item for mutually exclusive view or formatting modes.

Multiple selection

Enable multiple independent options when more than one state may be active.

Vertical

Match orientation to the visual arrangement so arrow-key navigation remains predictable.

Registry

Installation

Add the component source and its declared dependencies with the shadcn CLI.

Install component
bunx --bun shadcn@latest add @rivetui/toggle-group
Inspect registry item

Public interface

API reference

Component-specific props are listed here. Native element and Base UI props continue to pass through.

ToggleGroup

PropTypeDefault
valuereadonly string[]—
defaultValuereadonly string[][]
onValueChange(value: string[], details) => void—
multiplebooleanfalse
orientation"horizontal" | "vertical""horizontal"
loopFocusbooleantrue
variant"outline" | "ghost""outline"
size"sm" | "md" | "lg""md"
disabledbooleanfalse

ToggleGroupItem

PropTypeDefault
valuestringrequired
disabledbooleanfalse
onPressedChange(pressed: boolean, details) => void—
Rivet UI / Toggle GroupComponents engineered, not decorated.