Skip to content

Error Summary for Angular

AngularForm Infrastructure

Lists every error after a failed submission as links that move focus to the offending field (GOV.UK error summary pattern). The summary is a labelled region that receives focus when shown, so screen readers announce its heading and contents once without a live region. Form uses it automatically; it can also be used on its own.

  • Linked errorsLists every error as a link that moves focus to the field that needs fixing.
  • Announced onceA labelled region that takes focus when shown, so screen readers read it once without a live region.
  • Custom focusItems can supply their own focus behavior, such as a component's focus method.
  • Standalone or automaticForm fills it for you, and it also works alone for server-rendered errors.

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

import { Component, viewChild } from '@angular/core';
import { AuiErrorSummary } from '@absoluteui/angular/error-summary';
import { AuiButton } from '@absoluteui/angular/button';
@Component({
selector: 'app-booking-errors',
imports: [AuiErrorSummary, AuiButton],
template: `
<aui-error-summary title="The booking was not saved" [headingLevel]="2"></aui-error-summary>
<button type="button" auiButton variant="primary" (click)="showServerError()">Save booking</button>`,
})
export class BookingErrorsComponent {
private readonly summary = viewChild.required(AuiErrorSummary);
showServerError(): void {
this.summary().show([{ message: 'The service is busy. Try again in a few minutes.' }]);
}
}
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 { AuiErrorSummary } from '@absoluteui/angular/error-summary';

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

Class AuiErrorSummary; template reference #ref="auiErrorSummary".

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

Input Type Default Description
title string Heading text. Default: localized “There is a problem”.
description string Optional text under the heading.
icons Partial<ErrorSummaryIcons> Heading icon override.
headingLevel HeadingLevel '2' Native heading element level.
focusOnShow boolean true Move focus to the summary when show() displays items. show(items, { focus }) overrides it per call.
locale string 'en-US' Locale of the default heading.
Output Payload Description
(navigate) ErrorSummaryNavigateDetail A summary link was activated and focus moved to its target. Re-emits aui-navigate.
Property Type Description
isVisible Signal<boolean> True while items are shown.

Call them through a viewChild query or a template reference.

Method Description
show(items: readonly ErrorSummaryItem[], options?: { focus?: boolean; } | undefined): void Replace the items and show the summary (an empty list hides it). Focuses and scrolls to the summary unless focus is false or focusOnShow is false. Throws on an empty message before changing anything.
clear(): void Remove all items and hide the summary without moving focus.

Pattern: GOV.UK error summary: a focusable, labelled region with a native heading and a list of in-page links to the invalid fields.

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