Overview
Breadcrumbs are a navigation pattern that helps users understand where they are in a site’s hierarchy and navigate between different levels. They display the path from the root of the site to the current page, with each level represented by a link. Breadcrumbs are best used for sites with a clear hierarchical structure, where users may need to navigate back to parent pages. They should not be used as a replacement for primary navigation.Installation
Usage
Current Page
The lastBreadcrumbItem in a breadcrumb trail should represent the current page and should not include an href prop. This will automatically render it as plain text with appropriate styling and set aria-current="page".
Props
Breadcrumb
The BreadcrumbItem components to display in the breadcrumb trail.
Overrides the default element name to apply unique styles with the Customization Provider.
BreadcrumbItem
The text content to display for this breadcrumb item.
URL to navigate to when the breadcrumb item is clicked. If omitted, the item will render as plain text representing the current page.
Overrides the default element name to apply unique styles with the Customization Provider.
Overrides the default element name of the parent Breadcrumb component to apply unique styles with the Customization Provider.
Automatically set by the parent Breadcrumb component. Indicates this is the last item and omits the separator.
Accessibility
- The Breadcrumb component uses
<nav>witharia-label="breadcrumb"to identify it as a breadcrumb navigation landmark. - Individual items are rendered as an ordered list (
<ol>) to convey the hierarchical relationship. - The current page item automatically receives
aria-current="page"and is rendered without a link. - Breadcrumb items with an
hrefuse the Anchor component which automatically handles external links with appropriate security attributes. - The separator (
/) hasrole="presentation"to hide it from screen readers.
Best Practices
Do
- Use breadcrumbs on sites with a clear hierarchical structure
- Keep breadcrumb labels short and descriptive
- Make the current page the last item without a link
- Use breadcrumbs to show location within a hierarchy, not for step-by-step navigation
Don’t
- Don’t use breadcrumbs as a replacement for primary navigation
- Don’t use breadcrumbs for single-level sites
- Don’t include the current page as a clickable link
- Don’t use more than one breadcrumb component per page