Skip to content

Button Group for Angular

AngularActions

A labelled role=group of related native buttons, visually attached (shared borders) or spaced, horizontal or vertical. Composes Button; keyboard interaction stays native (Tab through every button).

  • Related actionsGroups buttons under one accessible label, attached or spaced apart.
  • Horizontal or verticalLays the buttons out in a row or a column.
  • One action eventEvery button reports its value through a single action event on the group.
  • Shared sizeOne size option keeps every button in the group consistent.

Behavior, design tokens, and limitations are described on the Button Group page; this page covers the Angular API.

import { Component } from '@angular/core';
import { AuiButtonGroup } from '@absoluteui/angular/button-group';
@Component({
selector: 'app-pager',
imports: [AuiButtonGroup],
template: `<aui-button-group label="Pagination" size="sm" [buttons]="buttons" (action)="go($event.value)"></aui-button-group>`,
})
export class PagerComponent {
readonly buttons = [
{ icon: 'chevron-left', label: 'Previous page', value: 'prev' },
{ icon: 'chevron-right', label: 'Next page', value: 'next' },
];
go(direction: string): void {
void direction;
}
}
Terminal window
npm install @absoluteui/angular @absoluteui/components @absoluteui/core @absoluteui/theme

Setup with provideAbsoluteUI() is covered in Getting started. Styles are included with the component.

import { AuiButtonGroup } from '@absoluteui/angular/button-group';

Defaults for every instance: provideAbsoluteUIConfig({ components: { buttonGroup: { ... } } }) (see Configuration).

Class AuiButtonGroup; template reference #ref="auiButtonGroup".

Server rendering: Renders on the server; the browser re-creates it after hydration.

Input Type Default Description
label string Required. Accessible name of the group (aria-label).
size ButtonSize Size of the Buttons the group creates or enhances; defaults to the Button configuration.
buttons readonly ButtonGroupButton[] create() only: Buttons to render. Icon-only buttons need a label.
orientation ButtonGroupOrientation 'horizontal' Layout direction.
attached boolean true Shared borders and no inner radii; false spaces the buttons with a gap and lets horizontal groups wrap.
Output Payload Description
(action) ButtonGroupActionDetail create() only: a button was activated. value defaults to the button index. Re-emits aui-action.

Pattern: Native buttons inside an element with role=group and an accessible name (WAI-ARIA group role). Not the APG Toolbar pattern.

The Angular component renders the framework-neutral component, so its keyboard support, roles, WCAG 2.2 criteria, budgets, and import cost apply unchanged: see Button Group: Accessibility and performance.