Skip to content

Toggle Group

Free

A set of toggles that share one value, such as text alignment. One or many can be on, in a row, a column, or as picture tiles.

  • Base UI
  • React 19
  • Tailwind CSS 4

Added Nov 8, 2026 · MIT + Commons Clause

Playground

Loading the preview

Props

Put a ToggleGroupItem per choice.

range-picker.tsx

ToggleGroup

<div>
PropTypeDefaultDescription
size"default""lg""sm""xs""default"Height 24, 28, 32, or 36px.
rounded"default""full""default"
classNamestring—
variant"default""outline""outline"The look of the items: outline (default) for a row of toggles, default for quiet rows with no border (a list of places or views in a panel, pressed on the accent fill).
spacing0.512342The gap between the items: 0.5 to 4 is 2 to 16px. Default 2 (8px).
From Base UIToggleGroupBase UI docs
valuereadonly Value[]—The pressed state of the toggle group represented by an array of the values of all pressed toggle buttons. This is the controlled counterpart of defaultValue.
defaultValuereadonly Value[]—The pressed state of the toggle group represented by an array of the values of all pressed toggle buttons. This is the uncontrolled counterpart of value.
onValueChange—Callback fired when the pressed states of the toggle group changes.
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

ToggleGroupItem

<button>
PropTypeDefaultDescription
classNamestring—
size"default""lg""sm""xs"—Height 24, 28, 32, or 36px.
rounded"default""full"—
From Base UIToggleBase UI docs
pressedboolean—Whether the toggle button is currently pressed. This is the controlled counterpart of defaultPressed.
defaultPressedbooleanfalseWhether the toggle button is currently pressed. This is the uncontrolled counterpart of pressed.
disabledbooleanfalseWhether the component should ignore user interaction.
...props<button> attributes—Every other attribute goes to the <button>, with a ref.

ToggleGroupTile

<button>
PropTypeDefaultDescription
classNamestring—
size"default""lg""sm"—sm 56 × 40, default 72 × 48, or lg 88 × 56. Default: from the group size.
mediabooleanfalseA square picture tile (#/lib/tile media): the box holds a sample <img> that fills it, and the 2px pressed edge draws over it. Default false.
From Base UIToggleBase UI docs
pressedboolean—Whether the toggle button is currently pressed. This is the controlled counterpart of defaultPressed.
defaultPressedbooleanfalseWhether the toggle button is currently pressed. This is the uncontrolled counterpart of pressed.
disabledbooleanfalseWhether the component should ignore user interaction.
...props<button> attributes—Every other attribute goes to the <button>, with a ref.

ToggleGroupTileBox

<span>
PropTypeDefaultDescription
...props<span> attributes—Every other attribute goes to the <span>, with a ref.

ToggleGroupTileCaption

<span>
PropTypeDefaultDescription
...props<span> attributes—Every other attribute goes to the <span>, with a ref.
  • Use it for a value that takes one choice or many.
  • Use multiple for many at once.
  • Use orientation="vertical" for a column.
  • To switch between views or panels, use tabs.
  • For one choice from a short list with no empty state, use a Segmented Control.
TabMoves focus to the group. It has one tab stop.
Left ArroworRight ArroworUp ArroworDown ArrowMoves the focus. It does not change the value. Right to left flips the sides.
HomeorEndGoes to the first or the last item.
EnterorSpacePresses the focused item.

Give the group an aria-label.

Each item is a button with a pressed state.

loopFocus is on, so the arrow keys wrap.

Built with

Installs with Toggle Group

Components
Toggle
  1. AddedToggle Group, with Toggle.
Open the release