Button Group

Alignment target:@astryxdesign/core v0.7.1 · ButtonGroup

ButtonGroup Props #

NameTypeDefaultDescription
labelstringrequiredAccessible name for the group.
orientation'horizontal' | 'vertical''horizontal'Connected direction and arrow-key navigation axis.
size'sm' | 'md' | 'lg''md'Default inherited by child buttons. An explicit child size wins.
elevation'none' | 'low' | 'med' | 'high''none'Shadow depth for the connected surface.
isDisabledbooleanfalseDisables every Button and IconButton in the group. Members stay focusable and the group keeps its Tab stop.

Slot #

ButtonGroup receives Button or IconButton through its required default slot.

Keyboard navigation #

KeyBehavior
Left and Right ArrowMove focus within a horizontal group.
Up and Down ArrowMove focus within a vertical group.
HomeFocus the first available button.
EndFocus the last available button.
  • The group is a single Tab stop. A disabled member is marked aria-disabled rather than natively disabled, so it stays focusable.
  • When every member is disabled, the Tab stop stays on one disabled member, so keyboard users can still reach the group.
  • Right-to-left horizontal layouts reverse the Left and Right Arrow behavior.

Template ref #

ButtonGroup exposes element. Its type is HTMLDivElement | null.

Native attributes #

The root element receives:

  • HTML attributes.
  • aria-* attributes.
  • data-* attributes.
  • class.
  • style.
  • Native event listeners.