Axon 911 Frontend DocsAxon 911 Frontend Docs
Axon 911 Frontend Docs
    Loading navigation…
U
User
Switch to light mode
  1. Components
  2. Button Group
  3. API and Development

Button group

API and Development

View SourceOpens in a new tabSubmit IssueOpens in a new tab
ButtonGroup is a flex container (role="group") that visually merges adjacent Button elements on the shared grouped-control tray (inset-subtle fill, alt2 border — same chrome as SegmentedControl / ToggleGroup). ButtonGroupSeparator inserts space between nested groups; ButtonGroupText adds a labeled static segment on that tray. Orientation is ButtonGroupOrientation.Horizontal (default) or Vertical.
ButtonGroup
NameTypeDefaultDescription
aria-descriptionLocalizedMessage—Extended description for assistive tech.
aria-labelLocalizedMessage—Accessible name when the visible label is insufficient.
aria-labelledbystring—Id of the element that names this group; use {@link ButtonGroupLabelledByProps} instead. Id of the element that names this group.
aria-placeholderLocalizedMessage—Hint for an empty control.
childrenReactNode—{@link Button } segments, plus {@link ButtonGroupText }, {@link ButtonGroupSeparator }, and nested {@link ButtonGroup } clusters. The group does not restyle anchors or other elements into buttons.
defaultValueDisplayValue | null—The Default variant has no group selection; use {@link ButtonGroupVariant.Expanding}. Value of the selected {@link ButtonGroupItem } on first render when uncontrolled. Defaults to none.
labelLocalizedMessage—Accessible name for the group (role="group"). Accessible name prop; use {@link ButtonGroupLabelProps} instead.
onValueChange((value: DisplayValue, details: ChangeDetails<ChangeReason>) => void)—The Default variant has no group selection; use {@link ButtonGroupVariant.Expanding}. Called when a segment is pressed. details.reason is {@link ChangeReason.ItemPress }. Pressing the selected segment does not call it: a selection cannot be cleared by the person using the group. Cancel the change to keep the previous selection. @param value - The pressed segment's value @param details - Change metadata
orientationButtonGroupOrientation—Main-axis layout. Defaults to {@link ButtonGroupOrientation.Horizontal}. The Expanding variant is a row; a column is not defined. Defaults to {@link ButtonGroupOrientation.Horizontal}.
refRef<HTMLDivElement>—Ref to the group element.
sizeButtonSize—Size passed to every direct {@link Button } child, and to nested groups, that sets no size of its own. A segment's own size wins. Defaults to {@link ButtonSize.Large}.
titleLocalizedMessage—Native tooltip; accessibility hint, not visible UI title text.
valueDisplayValue | null—The Default variant has no group selection; use {@link ButtonGroupVariant.Expanding}. Value of the selected {@link ButtonGroupItem } when controlled; null selects none.
variantButtonGroupVariant—Look of the group. Defaults to {@link ButtonGroupVariant.Default}. Makes the selected segment grow to show its label while the others stay icon-only. Hovering a collapsed segment with a mouse or pen, or moving keyboard focus to it, shows its label in a Tooltip and never changes a width; touch shows no tooltip, a tap selects. Pressing a segment selects it and shows its label.
Storybook
Interactive examples and edge cases for this component are in Storybook.
DefaultOpens in a new tab
Related exports
NameTypeDefaultDescription
ButtonGroupSeparatorBox props + orientation—Gap between sub-groups.
ButtonGroupTextFlexBox props—Non-action label segment.
Basic
With icon button
With dropdown menu
Nested groups
Vertical orientation
With text
With separator
Small buttons
All variants
Single button
Icon buttons only
With status dot
Lead and tail icons
Previous
Button Group / Usage
Next
Button Group / Accessibility
On this page
ButtonGroup
Storybook
Related exports
Basic
With icon button
With dropdown menu
Nested groups
Vertical orientation
With text
With separator
Small buttons
All variants
Single button
Icon buttons only
With status dot
Lead and tail icons