Skip to content

Alert for Angular

AngularFeedback

Prominent message block for page- or section-level status (info, success, warning, error) with a tone icon, a visually hidden localized tone prefix, optional title, actions, and dismiss button. Static by default; opt-in live role (status or alert) for messages inserted or changed after load.

  • Four tonesInfo, success, warning, and error, each with its own icon and color.
  • ActionsOptional buttons report their value, so the alert can offer the next step.
  • DismissibleA close button removes the alert through a dismiss event you can cancel.
  • Live announcementsChoose polite or assertive announcement for alerts that appear later.

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

import { Component } from '@angular/core';
import { AuiAlert } from '@absoluteui/angular/alert';
@Component({
selector: 'app-save-status',
imports: [AuiAlert],
template: `<aui-alert tone="error" live="assertive" title="Could not save" [message]="message" [dismissible]="true" [actions]="actions" (action)="onAction($event.value)"></aui-alert>`,
})
export class SaveStatusComponent {
readonly message = 'Check your connection and try again.';
readonly actions = [{ label: 'Retry', value: 'retry' }];
onAction(value: string): void {
if (value === 'retry') {
// retry the save
}
}
}
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 { AuiAlert } from '@absoluteui/angular/alert';

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

Class AuiAlert; template reference #ref="auiAlert".

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

Input Type Default Description
message string | Node Message; strings render as text.
tone AlertTone 'info' Tone: icon, colors, and hidden tone prefix.
title string Optional title (text).
live AlertLive 'off' off: static; polite: role=status; assertive: role=alert. Announces content inserted or changed after load.
actions readonly AlertAction[] Buttons { label, value, variant? } that emit aui-action.
icons Partial<AlertIcons> Icon slot overrides.
dismissible boolean false Render a dismiss button (localized ‘Dismiss’).
locale string 'en-US' Locale of the tone prefix and dismiss label.
Output Payload Description
(action) AlertActionDetail An action button was activated. Re-emits aui-action.
(dismissed) AlertDismissDetail Before the alert hides; preventDefault keeps it visible. Re-emits aui-dismiss.
Property Type Description
isDismissed Signal<boolean> Whether the alert was dismissed (hidden).

Call them through a viewChild query or a template reference.

Method Description
dismiss(): boolean | undefined Emit cancelable aui-dismiss, then hide unless prevented. Returns whether it was dismissed.

Pattern: WAI-ARIA APG Alert pattern (role=alert) for urgent dynamic messages; role=status for polite updates; plain content when static.

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