Skip to content
Browse docs and components

Toggle group

toggle-group

A row of toggles that share a value, or several. One control rather than a row of separate buttons: the selected one is filled and its neighbours stay quiet, and it works for icon-only formatting bars and for labelled density switches alike.

Responsive

Install

$npxshadcnadd@forme/toggle-group

Adds the component, its registry dependencies, and the token stylesheet you import once.

API reference

Read from the source, so it is the API of the file you install. A prop marked * is required.

ToggleGroup

A group of toggles that share a value, or several.

PropTypeDefaultDescription
toggle"default" | "outline"—

Also takes every prop of ComponentProps<typeof ToggleGroupPrimitive>.

Toggle

PropTypeDefaultDescription
destructiveboolean—Render destructive: for a toggle that turns something off on purpose.

Also takes every prop of ComponentProps<typeof TogglePrimitive>.