forty-cdk
llms.txt

Primitives

Breadcrumbs

A labelled navigation landmark for a breadcrumb trail: links with aria-current='page' on the current page and decorative separators hidden from assistive technology.

forty-cdk/breadcrumbs WAI-ARIA APG

Walk the trail with Tab: the last crumb is the page you are on, so it carries aria-current="page" and is not a link back to itself.

Anatomy

<nav forBreadcrumbs>
  <ol>
    <li><a forBreadcrumbItem href="/">Home</a></li>
    <li forBreadcrumbSeparator>/</li>
    <li><a forBreadcrumbItem href="/data" current>Data</a></li>
  </ol>
</nav>

Examples

Collapsing a long trail

The primitive renders whatever items you give it, so collapsing a deep path is a consumer decision. Here the middle is folded into an expandable ellipsis button that reveals the hidden crumbs. The trail stays a single accessible navigation landmark either way.

Localizing the label

Breadcrumb is verbalized by screen readers, so translate it per injector scope with provideForBreadcrumbsDefaults. Configure it at the application root, or in any component's providers to scope the translation to a subtree. A per-instance [ariaLabel] still wins over the scope default.

import { provideForBreadcrumbsDefaults } from 'forty-cdk/defaults';

bootstrapApplication(App, {
  providers: [provideForBreadcrumbsDefaults({ label: 'Ruta de navegación' })],
});

For a language the app sets or switches after bootstrap, pass label as a function and the overrides as a factory, as Localizing default text shows.

API

ForBreadcrumbs

PropertyTypeDescription
ariaLabel
input
Accessible label for the navigation landmark. Override when a page hosts more than one breadcrumb trail.
Default: 'Breadcrumb'

ForBreadcrumbItem

PropertyTypeDescription
current
input
When true, reflects aria-current="page" on the link.
Default: —

Accessibility

Implements the WAI-ARIA Breadcrumb pattern.

  • Navigation landmark. [forBreadcrumbs] applies role="navigation" and labels it aria-label="Breadcrumb" by default, creating a named landmark that screen-reader users can jump to directly. When a page hosts more than one trail, name each with [ariaLabel], or point a native aria-labelledby at a visible heading.
  • Current page. Set current on [forBreadcrumbItem] for the active page; the directive reflects aria-current="page" so assistive technology announces the user's location in the trail.
  • Decorative separators. [forBreadcrumbSeparator] reflects aria-hidden="true" so the visual divider (e.g. /) is skipped by screen readers.

Styling

forty-cdk ships no styles. Style the current item via [aria-current="page"].

[forBreadcrumbItem][aria-current='page'] {
  font-weight: bold;
  color: inherit;
  text-decoration: none;
}