Toggle Group for Angular
Introduction
Section titled “Introduction”Named group of toggle buttons (aria-pressed) for one setting with a few choices, such as text alignment, a list or grid view, or text styles: single selection (at most one pressed, optionally required) or multiple. Roving tabindex: one button in the tab sequence, arrow keys between buttons.
- Single or multipleWorks like a radio group or like a set of independent toggles.
- Required selectionOptionally keeps at least one item pressed at all times.
- Icons and labelsItems show text, an icon, or only an icon with the label as its name.
- Keyboard friendlyArrow keys move between items and Space or Enter toggles them.
Behavior, design tokens, and limitations are described on the Toggle Group page; this page covers the Angular API.
Live example
Section titled “Live example”import { Component } from '@angular/core';import type { ToggleGroupItem } from '@absoluteui/components/toggle-group';import { AuiToggleGroup } from '@absoluteui/angular/toggle-group';
@Component({ selector: 'app-view-switch', imports: [AuiToggleGroup], template: `<aui-toggle-group label="View" [items]="views" [required]="true" [attached]="true" [(value)]="view"></aui-toggle-group>`,})export class ViewSwitchComponent { view: string[] = ['list']; readonly views: ToggleGroupItem[] = [{ value: 'list', label: 'List' }, { value: 'grid', label: 'Grid' }];}Install and start
Section titled “Install and start”npm install @absoluteui/angular @absoluteui/components @absoluteui/core @absoluteui/themeSetup with provideAbsoluteUI() is covered in Getting started. Styles are included with the component.
import { AuiToggleGroup } from '@absoluteui/angular/toggle-group';Defaults for every instance: provideAbsoluteUIConfig({ components: { toggleGroup: { ... } } }) (see Configuration).
API reference
Section titled “API reference”<aui-toggle-group>
Section titled “<aui-toggle-group>”Class AuiToggleGroup; template reference #ref="auiToggleGroup".
Server rendering: Renders on the server; the browser re-creates it after hydration.
Angular forms: implements ControlValueAccessor; the form value is string[]. Bind [formControl], formControlName, or [(ngModel)]; validation messages of the component report through the aui error key. See Forms.
Inputs
Section titled “Inputs”| Input | Type | Default | Description |
|---|---|---|---|
label |
string |
Required. Accessible name of the group. | |
items |
readonly ToggleGroupItem[] |
Required. Buttons: { value, label, icon?, iconOnly?, disabled? } (1 to 100, unique values). | |
multiple |
boolean |
false |
Allow several pressed items. |
required |
boolean |
false |
Single mode: one item stays pressed. |
orientation |
"horizontal" | "vertical" |
'horizontal' |
Layout and arrow-key axis. |
attached |
boolean |
false |
Join the buttons into one segmented control. |
disabled |
boolean |
false |
Disable every button. |
size |
ButtonSize |
'md' |
Button size. |
Two-way bindings
Section titled “Two-way bindings”| Model | Type | Change output | Description |
|---|---|---|---|
[(value)] |
string[] |
(valueChange) |
The value: [(value)] without forms; with Angular forms, bind the form control instead. |
Outputs
Section titled “Outputs”| Output | Payload | Description |
|---|---|---|
(changed) |
ToggleGroupChangeDetail |
The user changed the pressed items: { value, changed }. Re-emits aui-change. |
Methods
Section titled “Methods”Call them through a viewChild query or a template reference.
| Method | Description |
|---|---|
focus(): void |
Focus the button in the tab sequence. |
Accessibility and performance
Section titled “Accessibility and performance”Pattern: WAI-ARIA toggle buttons (button with aria-pressed) in a named group, with roving tabindex as in 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 Toggle Group: Accessibility and performance.
(c) 2026 Kasadara Technology Solutions Pvt Ltd. AbsoluteUI is free to use under the AbsoluteUI Free Use License; it is not open source.