Documentation

ButtonGroup

A segmented radio group for mutually exclusive settings. It shares its neutral selection surface, spacing, and typography with segmented Tabs. Use Tabs when switching between content panels.

Props

PropTypeRequiredDescription
labelstringYesAccessible name for the radio group
optionsButtonGroupOption<Value>[]YesAvailable { value, label, icon? } options
valuestring | numberYesCurrently selected value
onValueChange(value) => voidYesCalled when the selection changes
disabledbooleanNoDisables every button
jssJSSNoExceptional group-level style overrides

Basic usage

Each option has the same rounded shape. Changing selection or adding and removing options does not change their corners.

const options = [
  { value: "list", label: "List", icon: "list" },
  { value: "grid", label: "Grid", icon: "grid-2x2" },
  { value: "columns", label: "Columns", icon: "columns-3" },
] as const;

const [view, setView] = useState("list");

<ButtonGroup
  label="View"
  options={options}
  value={view}
  onValueChange={setView}
/>;

Text options

Icons are optional. Keep the set short enough that every choice remains immediately readable.

Disabled

Accessibility

  • The container uses role="radiogroup" and each option uses role="radio".
  • aria-checked exposes the selected option.
  • Arrow keys move and select; Tab enters and leaves the group as one control.