Skip to content

Breadcrumb for Angular

AngularNavigation

WAI-ARIA APG Breadcrumb: a labelled <nav> with an ordered list of links to the current page’s ancestors, the current page marked with aria-current, optional collapsing behind an expander, validated hrefs, and a cancelable navigate event for client-side routers.

  • Clear locationA navigation landmark with the current page marked for assistive technology.
  • Collapses long trailsA maximum item count folds the middle of long trails into an expandable item.
  • Cancelable navigationNavigate events can be canceled to hand links to a client-side router.
  • Localized and RTLLabels follow the locale and separators mirror in right-to-left layouts.

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

import { Component, inject } from '@angular/core';
import { Router } from '@angular/router';
import type { BreadcrumbItem, BreadcrumbNavigateDetail } from '@absoluteui/components/breadcrumb';
import { AuiBreadcrumb } from '@absoluteui/angular/breadcrumb';
@Component({
selector: 'app-trail',
imports: [AuiBreadcrumb],
template: `<aui-breadcrumb [items]="items" [maxItems]="3" (aui-navigate)="go($event)"></aui-breadcrumb>`,
})
export class TrailComponent {
private readonly router = inject(Router);
readonly items: BreadcrumbItem[] = [{ label: 'Home', href: '/' }, { label: 'Projects', href: '/projects' }, { label: 'Atlas' }];
go(event: Event): void {
const { item } = (event as CustomEvent<BreadcrumbNavigateDetail>).detail;
if (item.href === undefined) return;
event.preventDefault();
void this.router.navigateByUrl(item.href);
}
}
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 { AuiBreadcrumb } from '@absoluteui/angular/breadcrumb';

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

Class AuiBreadcrumb; template reference #ref="auiBreadcrumb".

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

Input Type Default Description
items readonly BreadcrumbItem[] Required. Trail from the root to the current page (last item). Items without href render as text.
label string 'Breadcrumb (localized)' Accessible name of the <nav>.
linkCurrent boolean false Render the current (last) item as a link when it has an href.
icons Partial<BreadcrumbIcons> Icon slot overrides.
maxItems number '0' 0 never collapses. Otherwise (>= 2), longer trails show the first item, an expander, and the last maxItems - 1 items.
locale string 'en-US' Message locale.
direction Direction 'ltr' rtl mirrors the separator icon.
Output Payload Description
(navigate) BreadcrumbNavigateDetail An unmodified primary click on a link. preventDefault stops native navigation so a router can handle it. Re-emits aui-navigate.
Property Type Description
expanded Signal<boolean> Whether the user expanded a collapsed trail.

Pattern: WAI-ARIA APG Breadcrumb 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 Breadcrumb: Accessibility and performance.