Skip to content

Button Group

The bq-button-group component joins related buttons into a single visual control.

Basic Usage

html
<bq-button-group label="Text alignment">
  <bq-button variant="outline">Left</bq-button>
  <bq-button variant="outline">Center</bq-button>
  <bq-button variant="outline">Right</bq-button>
</bq-button-group>

Attached

attached removes the gap so the buttons share borders and only the outer corners stay rounded:

html
<bq-button-group attached label="Text alignment">
  <bq-button variant="outline">Left</bq-button>
  <bq-button variant="outline">Center</bq-button>
  <bq-button variant="outline">Right</bq-button>
</bq-button-group>

Orientation

html
<bq-button-group orientation="vertical" attached label="Actions">
  <bq-button variant="outline">Edit</bq-button>
  <bq-button variant="outline">Duplicate</bq-button>
  <bq-button variant="outline">Delete</bq-button>
</bq-button-group>

Shared Size

Set size once on the group instead of on every button. A size set explicitly on a child always wins:

html
<bq-button-group size="sm">
  <bq-button>Save</bq-button>
  <bq-button>Cancel</bq-button>
  <bq-button size="lg">Publish</bq-button>
</bq-button-group>

Properties

PropertyTypeDefaultDescription
orientationstring'horizontal'horizontal | vertical
sizestring''sm | md | lg — forwarded to slotted buttons
attachedbooleanfalseCollapse the gap so buttons share borders
labelstring''Accessible label for the group

Slots

SlotDescription
(default)Buttons (bq-button, bq-icon-button or native button)

CSS Parts

PartDescription
groupThe group container

Accessibility

  • The group exposes role="group" with an accessible name, so screen readers announce the buttons as one set.
  • Buttons keep their own semantics and tab order; the group adds no keyboard behavior of its own.
  • The focused button is lifted above its neighbours so its focus ring is never clipped by an adjacent border.
  • For a single-choice control such as a view switcher, prefer bq-segmented-control, which has radio-group semantics.

Released under the MIT License.