Skip to content

Toast for Angular

AngularFeedback

Transient notifications stacked in a labelled region (section aria-label ‘Notifications’) rendered in the top layer with popover=manual. Each toast is announced once through the shared live regions (polite for info/success, assertive for warning/error), never steals focus, pauses while hovered or focused, and can be reached with a hotkey (default Alt+T) and dismissed with Escape.

  • Queued notificationsShows a few toasts at once and queues the rest until there is room.
  • Timers that waitAuto-dismiss pauses while users hover or focus the toasts.
  • Keyboard shortcutA hotkey moves focus to the newest toast and back to where users were.
  • Optional actionOne action button per toast, such as Undo, closes it when pressed.
  • Six positionsPlace the region in any corner or centered at the top or bottom.

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

main.ts
import { bootstrapApplication } from '@angular/platform-browser';
import { provideAbsoluteUI } from '@absoluteui/angular';
import { provideAuiToaster } from '@absoluteui/angular/toast';
import { AppComponent } from './app.component';
bootstrapApplication(AppComponent, { providers: [provideAbsoluteUI(), provideAuiToaster({ position: 'top-end', max: 3 })] });
save-button.component.ts
import { Component, inject } from '@angular/core';
import { AuiToaster } from '@absoluteui/angular/toast';
import { AuiButton } from '@absoluteui/angular/button';
@Component({
selector: 'app-save-button',
imports: [AuiButton],
template: `<button type="button" auiButton variant="primary" (click)="save()">Save</button>`,
})
export class SaveButtonComponent {
private readonly toaster = inject(AuiToaster);
save(): void {
this.toaster.show({ tone: 'success', message: 'Changes saved' });
}
}
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 { AuiToaster } from '@absoluteui/angular/toast';

Injectable service.

Angular service for Toast notifications: inject(AuiToaster).show({ tone: 'success', message: 'Saved' }). The toaster region is created lazily in the browser; on the server show() returns null and renders nothing.

Method Description
show(options: ToastOptions): ToastHandle | null Show a toast; returns its handle (dismiss, update), or null on the server.
clear(): void Dismiss every toast.
provideAuiToaster(options: ToasterOptions): Provider

Configure the application toaster (position, max, duration, hotkey).

Pattern: Notification region (labelled section landmark) with announcements through shared visually hidden live regions (WCAG 4.1.3); toasts are not live regions themselves, to avoid double announcements.

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