Skip to content
Alpha

Hololink UI is under active development. Components, APIs and these docs may change without notice.

Holo Button Group

The <holo-button-group> component groups related buttons together with role="group" semantics and a shared visual gap. Use the orientation prop to lay buttons out horizontally or vertically, and the label prop to give the group an accessible name.

Use it for:

  • Grouping related buttons that act on the same thing, such as a toolbar of formatting actions.
  • Laying out buttons horizontally or vertically with shared spacing.

Don’t use it for:

  • Switching between views. Use Tabs.
  • Choosing one value from a set. Use Radio or Select.
  • Laying out arbitrary content. Use Stack.
<holo-button-group label="Text formatting">
<holo-button label="Bold" variant="secondary"></holo-button>
<holo-button label="Italic" variant="secondary"></holo-button>
<holo-button label="Underline" variant="secondary"></holo-button>
</holo-button-group>
<holo-button-group label="Actions" orientation="vertical">
<holo-button label="Save" variant="primary"></holo-button>
<holo-button label="Cancel" variant="secondary"></holo-button>
</holo-button-group>

The host has role="group", and aria-label is set from the label prop when provided. It adds no behaviour of its own: each slotted button is a normal tab stop, so keyboard use is exactly that of the buttons inside. See Button.

Key Action
Tab Moves between buttons in the group, one stop each
Enter, Space Activates the focused button
  • There is no roving tabindex and no arrow-key navigation.

You provide:

  • A label that names the group (“Text formatting”). Without it the group has no accessible name.
  • An accessible name for every button inside, including Icon Buttons.

Importing

import '@philbob-sideprojects/hololink-ui/holo-button-group';

Properties

PropertyAttributeTypeDefaultDescription
labellabelstring—Optional accessible name for the group, exposed via aria-label.
orientationorientation"horizontal" | "vertical"'horizontal'The layout direction of the grouped buttons.

Slots

SlotDescription
(default)The holo-button/holo-icon-button elements to group.

CSS custom properties

PropertyDescription
--holo-button-group-gapSpace between grouped buttons.