4.2.0
Core

Breadcrumb

The path down to this page, one link per level above it โ€” a signpost for surfaces deep enough to get lost in, never the way to move between them.

Breadcrumb

One link per level above this page, then the page itself as plain text. Reach for it when a reader can land here from a link and have no idea what contains it.

Usage

import {
  Breadcrumb,
  BreadcrumbEllipsis,
  BreadcrumbItem,
  BreadcrumbLink,
  BreadcrumbList,
  BreadcrumbPage,
  BreadcrumbSeparator,
} from '@oceanic-hub/brand-system'
<Breadcrumb>
  <BreadcrumbList>
    <BreadcrumbItem>
      <BreadcrumbLink>โ€ฆ</BreadcrumbLink>
      <BreadcrumbPage>โ€ฆ</BreadcrumbPage>
    </BreadcrumbItem>
    <BreadcrumbSeparator>โ€ฆ</BreadcrumbSeparator>
  </BreadcrumbList>
</Breadcrumb>

Composition

Use the following composition to build a Breadcrumb:

Breadcrumb
โ””โ”€โ”€ BreadcrumbList
    โ”œโ”€โ”€ BreadcrumbItem ร—4
    โ”‚   โ”œโ”€โ”€ BreadcrumbLink
    โ”‚   โ”œโ”€โ”€ BreadcrumbPage
    โ”‚   โ””โ”€โ”€ BreadcrumbEllipsis
    โ””โ”€โ”€ BreadcrumbSeparator ร—3

Reach for it when a reader can arrive somewhere deep without having walked there: a search result, a shared link, a notification. On a flat product it is furniture โ€” three levels that never change say nothing the page title has not already said.

It is a signpost, not a control. When a segment's job is to switch โ€” pick another workspace, another project, another environment at the same level โ€” that is BreadcrumbSwitcher, a patterns-tier component whose segments open a menu of their siblings. The two look alike and answer different questions: this one tells you where you are, that one moves you.

The last segment is the page you are on, so it is not an anchor and goes nowhere โ€” but it keeps upstream's role="link" + aria-disabled pairing, so it is still announced as a link, with aria-current="page" carrying the meaning. Separators are role="presentation" and hidden from assistive tech, so the trail is announced as a list of links with no punctuation between them; the glyph is a purely visual choice and defaults to a chevron when you pass none.

BreadcrumbEllipsis is decorative in the same way, which has a consequence worth stating: on its own it hides levels from everyone and offers them back to nobody. If the collapsed levels are somewhere a reader would actually go, wrap it in a DropdownMenu and give that trigger its own label โ€” the ellipsis cannot supply one, because it is aria-hidden.

asChild is what keeps the trail from reloading the application. Hand it your router's link and BreadcrumbLink renders that instead of an <a>; upstream's Base UI generation spells the same idea render, which is a type error here.

Two smaller differences from upstream, both deliberate. Its links ship with no focus treatment at all, so a keyboard user tabbing the trail saw nothing โ€” ours draw a ring-brand ring, and that is a defect fix rather than an option. And its root advertises a separator prop that is spread straight onto the <nav> element and warns; it does not come across, and the drop is pinned in the contract test so a future paste cannot reintroduce it.

RTL is not supported. Upstream ships an Arabic example; nothing in this package has ever been laid out or measured right-to-left, and a trail is where that would show first. The refusal is written down in pairings.json under direction rather than left to be discovered.

Collapsed

BreadcrumbEllipsis stands in for the levels in the middle when the trail is longer than the bar it sits in. Reach for it when the ends are what orient a reader โ€” the root they came from and the page they are on โ€” and the levels between are only structure.

Wrap the ellipsis in a DropdownMenu and the collapsed levels are one click away instead of gone. Reach for it when the middle of the path is somewhere a reader still goes. The trigger needs its own label: the ellipsis is aria-hidden, so it cannot name the button it sits in.

Custom separator

The glyph is BreadcrumbSeparator's children, and omitting them gives the chevron. Reach for another when the trail sits in a bar that is already full of chevrons, or when the path is a literal one a reader would type. Separators are hidden from assistive tech, so this is a purely visual choice.

Framework routing

asChild makes BreadcrumbLink adopt the element you hand it instead of rendering its own <a>, so your router's link keeps client-side navigation and the trail stops reloading the application. Reach for it in every real surface โ€” a bare href is fine only where there is no router. Upstream's Base UI generation spells the same idea render, which does not exist here.

API Reference

See the Breadcrumb API page for every prop of every part, with types, defaults and the contract that pins them.

On this page