Breadcrumbs are a secondary navigation that displays a user's location within a website or application.
Breadcrumbs are a visual representation of the site's navigational hierarchy. They indicate the current page's location and allows users to easily move up to a parent level.
[daff-breadcrumb]
is required to be used with the native HTML <ol>
element.[daffBreadcrumbItem]
needs to be a <li>
element.Breadcrumbs are built using [daff-breadcrumb]
and [daffBreadCrumbItem]
.
[daff-breadcrumb]
: a wrapper for grouping breadcrumb items.[daffBreacrumbItem]
: used to display each breadcrumb item.import { DAFF_BREADCRUMB_COMPONENTS } from '@daffodil/design/breadcrumb';
@Component({
selector: 'custom-component',
templateUrl: './custom-component.component.html',
imports: [
DAFF_BREADCRUMB_COMPONENTS,
],
})
export class CustomComponent {}
<ol daff-breadcrumb>
<li daffBreadcrumbItem>
<a routerLink="/link">Link</a>
</li>
<li daffBreadcrumbItem>
<a routerLink="/link">Link</a>
</li>
<li daffBreacrumbItem>
<span>Active Link</span>
</li>
</ol>
Breadcrumb follows the Breadcrumb WAI-ARIA design pattern.
aria-current="page"
is automatically applied to the last item to indicate that it represents the current page.In order to fully comply with the WAI-ARIA design pattern:
<nav>
element so that assistive technologies can present the breadcrumbs as a navigational element on the page.aria-label="Breadcrumb"
on the nav
element to provide more context into what kind of navigation it is.<nav aria-label="breadcrumb">
<ol daff-breadcrumb>
</ol>
</nav>