Breadcrumbs
Show users their path and allow quick backtracking to higher-level pages.
#Examples
Breadcrumbs are a secondary navigation aid, showing users their current location within an application and enabling quick navigation back to higher-level pages.
#Default
The standard breadcrumb displays a clickable path of the user's current location. Each segment represents a level in the hierarchy, separated by the visual delimiter "/". The final segment (current page) is rendered as text, and therefore the last item in the items
array should not have a url
or onClick
prop or the value of those should be null
.
Best practices:
- Use for applications with multi-step processes where users need to track progress.
- Start with the highest-level parent page and move deeper into the information architecture as the breadcrumb trail progresses.
- Limit breadcrumbs to a maximum of 6 items for optimal usability. (See guideline below).
Use cases:
- Use for applications with multi-step processes where users need to track progress.
const items = [
{ title: "Siteimprove", url: "https://siteimprove.com/" },
{ title: "Github", url: "https://github.com/" },
{ title: "Wikipedia" },
];
return <Breadcrumbs items={items} aria-label="Breadcrumbs" />;
#Non-navigable breadcrumb
This type visually represents the path but without clickable links or onClick
handlers. It's used to show the user's location. In the example below, the url
props have the value null
, but the props can also be omitted.
Use cases:
- Use for read-only views (e.g., search results) where navigation isn't necessary.
- Use when the hierarchy is simple and easily understood without clicking.
const items = [
{ title: "Siteimprove", url: null },
{ title: "Github", url: null },
{ title: "Not Navigable", url: null },
];
return <Breadcrumbs items={items} aria-label="Breadcrumbs - non-navigable current page" />;
#Breadcrumb with custom "onclick" handlers
This variation allows custom actions (e.g., filtering, triggering functions) when a breadcrumb segment is clicked.
Best practices:
- Page content-specific actions tied to the breadcrumb's context
const items = [
{ title: "Products", url: "#", onClick: () => alert("Products") },
{ title: "Documentation", url: "#", onClick: () => alert("Documentation") },
{ title: "Contact us" },
];
return <Breadcrumbs items={items} aria-label="Breadcrumbs - custom onclick event" />;
#Properties
Property | Description | Defined | Value |
---|---|---|---|
itemsRequired | object[] | ||
aria-labelRequired | string | ||
noPaddingOptional | boolean If true, the breadcrumb will not have padding |
#Guidelines
#Best practices
#Do not use when
#Accessibility
Explore detailed guidelines for this component: Accessibility Specifications