Toggle Group

A set of two-state buttons that can be toggled on or off, typically used for filtering or switching between different views or options.

Basic

With type="single", one item is on at a time and a sliding indicator marks it.

Multiple selection

With type="multiple", several items can be on at once. The sliding indicator only shows in single mode, so selected items are marked by their text color.

Sizes

Set size on the root: regular (the default) or small. The heights match the Button scale.

Small
Regular

With icons

Use iconStart or iconEnd for icons. Keep children reserved for the item label; icon-only items must provide an accessible label.

Controlled

Pass value and onValueChange to control the selection. In single mode, clicking the selected item passes an empty string; ignore it to keep one item selected.

Showing the last 30 days

Disabled

Set disabled on an item to make it unavailable. Arrow-key navigation skips it.

ToggleGroup.Root

typeRequired
'single''multiple'

The type of toggle group - single or multiple selection

value
stringstring[]

The current value(s) of the toggle group (controlled)

defaultValue
stringstring[]

The default value(s) of the toggle group (uncontrolled)

onValueChange
(value: string | string[]) => void

Callback fired when the value changes

size
'regular''small'

Control height and item typography. Matches the Button scale

Default: regular

orientation
'horizontal''vertical'

Lays the items out in a row or a column

Default: horizontal

disabled
boolean

Whether the toggle group is disabled

Default: false

aria-label
string

Accessible label for the toggle group

className
string

Additional CSS classes to apply to the toggle group

indicatorClassName
string

Additional CSS classes for the sliding active indicator


ToggleGroup.Item

valueRequired
string

The value of the toggle item

children
string

Label displayed by the toggle item

aria-label
string

Accessible label for the toggle item. Required when the item has no children

iconStart
IconValue

Icon displayed before the label

iconEnd
IconValue

Icon displayed after the label

disabled
boolean

Whether the toggle item is disabled

Default: false

className
string

Additional CSS classes to apply to the toggle item

labelClassName
string

Additional CSS classes for the label slot

iconStartClassName
string

Additional CSS classes for the start icon slot

iconEndClassName
string

Additional CSS classes for the end icon slot