Button Group

Related actions with a named group and ordinary Tab order. This lightweight container adds no action engine or selection model. Each child keeps its own keyboard behavior, disabled state, form owner and event handling.

Usage

<script type="module" src="/assets/components/button-group/qds-button-group.js"></script>
<script type="module" src="/assets/components/button/qds-button.js"></script>
<qds-button-group label="Draft actions">
  <qds-button>Save draft</qds-button>
  <qds-button variant="secondary">Discard</qds-button>
</qds-button-group>

API

Property / attribute Type Default Meaning
label string empty Name of the related actions. Supply it for meaningful groups.
orientation horizontal / vertical horizontal Visual layout; invalid values use horizontal.

The default slot retains arbitrary controls. The group part exposes the flex surface, which wraps horizontal actions on narrow screens. Vertical groups stack their controls. Updates and reconnection preserve all child state.

Accessibility and composition

The surface has role="group" and uses label as its accessible name. Tab and Shift+Tab visit the children’s native focus stops. Arrow keys retain the child’s own meaning. Safari’s default keyboard preference uses Option+Tab to include all controls; enabling full keyboard navigation allows Tab. The group adds no focus stop and does not imply a toolbar, radio group or exclusive selection. Set disabled/loading on each relevant action; use a native fieldset when several form controls share a disabled state.

Angular business example

The generated QdsButtonGroupComponent groups Northwind’s priority filter and Reset filters action at /#/investments/pipeline, reachable through Investments > Pipeline. Each action changes the visible opportunities. Filter state is local to the screen and resets when its component is recreated.