Skip to content
SevenUI
Sign in
On this page

Toggle Group

Displays a toggle group built on the Base UI Toggle Group primitive.

Installation

Bash

Usage

Multiple Selection

Examples

Multiple

An outline, multi-select formatting group — multiple allows several pressed items at once.

API reference

ToggleGroup

Extends the Base UI Toggle Group primitive — all its props apply. The value is always an array of strings, even in single-selection mode (defaultValue={["center"]}). variant and size cascade to every item.

PropTypeDefault
multiplebooleanfalse
value / defaultValuestring[]—
onValueChange(value: string[]) => void—
variant"default" | "outline""default"
size"default" | "sm" | "lg""default"
spacingnumber — gap between items2
orientation"horizontal" | "vertical""horizontal"

ToggleGroupItem

Extends the Toggle component — requires a value; variant and size come from the group. Give icon-only items an aria-label.

Was this page helpful?