Breadcrumb
A trail that shows users where they are and leads them back to the levels above.
A breadcrumb lists the levels that lead from the top of the application to the page users are on. Every level above that page is a link, so users can go back to any of them in one step.
Usage
Examples
Custom Separator
Where a product already separates levels with a mark of its own, the trail repeats that mark instead of introducing a second one. The separator shows any element passed to it as children in place of its default mark, and it stays hidden from assistive technology, so screen readers announce only the levels.
With Ellipsis
Deep hierarchies, such as product categories with many levels, produce trails that would wrap over several lines. An ellipsis then takes the place of the levels that users need least for orientation, so the trail stays short and keeps the page they are on in view.
Link as Button
Not every level has an address of its own, for example inside a dialog in which users drill down from a region to a single store without leaving the page. With render set to a button, a level becomes an action that the application handles, such as a return to an earlier step, and users still reach it with the keyboard.
API Reference
Breadcrumb
Breadcrumb marks the trail as navigation and labels it "breadcrumb" for assistive technology. It renders a nav and has no props of its own.
BreadcrumbList
BreadcrumbList holds the items and the separators in order and wraps them onto the next line when they don't fit in one. It renders an ol and has no props of its own.
BreadcrumbItem
BreadcrumbItem holds one level of the trail: a link, the page or the ellipsis. It renders an li and has no props of its own.
BreadcrumbLink
| Prop | href |
|---|---|
| Type | string |
| Default | – |
| Description | Sets the address of the level that the link opens. Leave it out when render supplies an element that needs no address or carries its own. |
| Prop | render |
|---|---|
| Type | ReactElement | render function |
| Default | – |
| Description | Replaces the native element or composes the link with another component. |
BreadcrumbPage
BreadcrumbPage names the page that users are on and marks it as the current page for assistive technology. It renders a span and has no props of its own.
BreadcrumbSeparator
| Prop | children |
|---|---|
| Type | ReactNode |
| Default | <IconChevronRight/> |
| Description | Replaces the chevron that the separator shows between two items. |
BreadcrumbEllipsis
BreadcrumbEllipsis stands for the levels that a shortened trail leaves out. It renders a span with three dots and has no props of its own.