Breadcrumbs
Usage
Use breadcrumbs on pages three or more levels deep (Fleet › depot › vehicle type › vehicle) so people can see where they are and step back up. Don't use them on top-level pages or for step-by-step flows (use a stepper).
- Each crumb is the title of that page, sentence case, short ("North Yard depot", not "Depot details for North Yard").
- The current page comes last and is not a link.
- Above 4 levels, collapse the middle into "…"; on phones only the parent remains.
Anatomy
- Landmark —
nav.breadcrumbs[aria-label=Breadcrumb] - Ordered list —
ol.breadcrumbs__list - Ancestor link —
a.breadcrumbs__link - Separator — "/" drawn by CSS, not read aloud
- Current page —
span.breadcrumbs__current[aria-current=page] - Overflow (optional) —
button.breadcrumbs__more+ul.breadcrumbs__overflow[popover]
Examples
States marked hover, focus-visible and active are frozen with .is-hover, .is-focus-visible, .is-active. Those classes share their rule with the real pseudo-class, so what you see is exactly what users get. Never use them in product code.
API
| Hook | Values | Purpose |
|---|---|---|
.breadcrumbs | block class | <nav>; inline-size container |
.breadcrumbs__list | __item | __link | __current | parts | Trail |
.breadcrumbs__more, .breadcrumbs__overflow | parts | Collapsed levels (popover via invoker) |
aria-current="page" | attribute | Current page |
Do and don't
Fleet > Vans > Van KX-219 (link to itself)
Accessibility
| Key | Behavior |
|---|---|
| Tab | Moves through the links (and the "…" button) |
| Enter | Follows a link; on "…" opens the hidden levels |
| Esc | Closes the hidden-levels list, focus returns to "…" |
- Screen readers announce "Breadcrumb, navigation" and "list, 4 items"; separators use CSS alt text
content: "/" / "", so they aren't read. - Current page:
aria-current="page"plus semibold, no underline. - "…" has a name that says what it reveals ("Show 3 more levels").
Tokens
| Custom property | Purpose |
|---|---|
--color-text-link | Ancestor links |
--color-text-default | Current page |
--color-text-subtle | Separator |
--color-elevation-surface-overlay, --overlay-radius | -shadow | Overflow list |
--focus-ring-* | Focus ring |