Breadcrumb
The path from the top of the app to the current page: Projects, Werewolf, Settings. Each ancestor is a link in secondary text; the current page is primary text, not a link. A caret sits between them.
React
Preview
Usage
When to use
- Show where a page sits on pages two or more levels deep, above the page title: Projects, Werewolf, Settings.
- Let users go back up to any parent page in one step.
When not to use
- The steps of a flow, such as checkout.
- The main navigation of the app.
- Sections of one page. Use Tabs.
Platform support
What each platform has, from the spec. A selected platform is highlighted.
| Name | Web | iOS | Android | Note |
|---|---|---|---|---|
| asChild | Yes | Deferred | Deferred | Not generated for iOS and Android. |
| items | No | Yes | Yes | Only on iOS, Android. |
| label | No | Yes | Yes | Only on iOS, Android. |
| maxItems | No | Yes | Yes | Only on iOS, Android. |
| value of keyboard: Tab | Yes | Deferred | Deferred |
Examples
Path
Long path
The middle steps sit in a menu behind a named trigger.
Do and don't
Do
- Show it on pages two or more levels deep, above the page title.
- Name each step as its page is titled.
- Collapse the middle of a long path into a menu, and keep the first and the last two steps.
Don't
- Don't make the current page a link.
- Don't use it for the steps of a flow; it shows where a page sits, not progress.
- Don't use it as the only navigation of the app.
Props
| Name | Type | Values | Default | Description |
|---|---|---|---|---|
| asChild | boolean | - | false | Set on BreadcrumbLink. Renders the child (the app's router link) with the link's look. Not generated for iOS and Android. |
| items | object | - | - | Native only: ordered list of breadcrumb steps; ancestors carry an action and the last step is the current page. Only on iOS, Android. |
| label | string | - | Breadcrumb | Native only: accessible name of the breadcrumb navigation. Only on iOS, Android. |
| maxItems | number | - | - | Native only: maximum visible items before collapsing middle steps into an ellipsis menu. Only on iOS, Android. |
Slots
| Name | Required | Description |
|---|---|---|
| list | yes | BreadcrumbList with a BreadcrumbItem per step and a BreadcrumbSeparator between steps. The last item holds a BreadcrumbPage. |
Anatomy
| Part | Description |
|---|---|
| root | Breadcrumb: a nav named Breadcrumb. |
| list | BreadcrumbList: the steps in a row that wraps, 14px secondary text, gap-sm. |
| item | BreadcrumbItem: one step. |
| link | BreadcrumbLink: an ancestor, a link in secondary text that turns primary and underlined on hover. asChild takes the app's own link component. |
| current | BreadcrumbPage: the current page in primary text, aria-current="page". |
| separator | BreadcrumbSeparator: a Tabler ChevronRight, 16px, secondary; pass children for another mark. |
| ellipsis | BreadcrumbEllipsis: Tabler Dots, 16px, for the steps left out of a long path. |
Accessibility
Role: navigation
| Keys | Action |
|---|---|
| Tab | Moves through the links; the current page and the carets are not focusable. |
- The nav is named Breadcrumb, so screen readers list it with the page's landmarks. Pass aria-label to rename it.
- The steps are an ordered list. The current page carries aria-current="page".
- The carets and the ellipsis are decorative and hidden from screen readers. A collapsed path goes in a DropdownMenu whose trigger is named, such as Show the full path.
- The caret turns around in a right-to-left page.
Install
npx werewolf-ui add breadcrumbRun npx werewolf-ui init once in your app before adding components. Init sets up tokens, their CSS import and agent rules. Add installs this component and its dependencies while preserving your theme. See Installation for requirements and the alternative registry setup.