Toggle Group

Segmented control on bits-ui ToggleGroup. With spacing=0 the children share a continuous rail; raise spacing for detached pills. Each segment is an independent Toggle that keeps its own hover, focus, and pressed states.

Single

Multiple

Detached pills

Sizes

Outline

Outline variant keeps the segment border visible in the unpressed state — useful on crowded toolbars where the rail needs to read as a control cluster at rest.

Disabled

Disable the whole group with disabled on the root, or disable individual items by passing disabled on a single ToggleGroupItem.

ToggleGroup props

Inherits from bits-ui ToggleGroup.Root. When spacing=0 the items seam into a rail; otherwise they become separated pills with a `--gap` token.

PropTypeDescription
'single' | 'multiple'Single picks one value at a time; multiple lets users stack toggles.
string | string[] (bindable)Currently selected value(s). String for single, array for multiple. Two-way bindable.
'default' | 'outline'Inherited from Toggle. Outline draws a bordered segment.
'default' | 'sm' | 'lg'Sets segment height to 36 / 32 / 40 px.
numberSpacing-scale gap between items. Zero fuses the rail; raise for detached pills.
'horizontal' | 'vertical'Layout axis. Vertical stacks segments.
booleanDisables every item in the group.