Toggle group

A row of raised toggle buttons, like bold, italic and underline in an editor. Single or multiple mode, each button with aria-pressed.

Install it the shadcn way: copy the source file into your project. It uses CSS 3D, Tailwind CSS v4 and Framer Motion, no WebGL.

ToggleGroup3D props

PropTypeDefaultDescription
itemsToggleItem[]The buttons in the group.
type"single" | "multiple""multiple""single" allows one pressed item at most, "multiple" allows any number.
valuestring[]Pressed values. Set it to control the component.
defaultValuestring[][]Pressed values at the start when uncontrolled.
onValueChange(value: string[]) => voidCalled with the new list of pressed values.
size"sm" | "md""md"Size of the buttons.
aria-labelstringRequired: names the group for screen readers.
classNamestringExtra classes added to the outer element.

More components

Guides

Start

Cards

Scenes

Controls & text

Buttons

More cards

UI elements

Form controls

App components

Text & backgrounds

Showpieces

Blocks