Skip to content

Breadcrumbs component

Breadcrumbs is a navigation trail with a chevron separator, automatic collapse-to-ellipsis when the path is long, and router-link polymorphism.

Navigation8 propsAccessibility notes

Playground

Change a prop on the right and the preview updates. Switch to Code to copy what you see.

Recipes

Copy-paste patterns for the ways Breadcrumbs actually gets used — each one a real, self-contained example.

Basic trail

A navigation trail — each BreadcrumbItem with an href is a link; the last item is the current page (no link, aria-current). Separators are drawn in CSS.

<Breadcrumbs aria-label="Basic breadcrumb">
  <BreadcrumbItem href="/">Home</BreadcrumbItem>
  <BreadcrumbItem href="/reports">Reports</BreadcrumbItem>
  <BreadcrumbItem isCurrent>Q3 revenue</BreadcrumbItem>
</Breadcrumbs>

Collapse a long path

maxItems collapses the middle of a deep path to an ellipsis (that expands on click), keeping the first and last crumbs visible.

<Breadcrumbs aria-label="Collapsed breadcrumb" maxItems={4}>
  <BreadcrumbItem href="/">Home</BreadcrumbItem>
  <BreadcrumbItem href="/a">Accounts</BreadcrumbItem>
  <BreadcrumbItem href="/a/b">Astrobit</BreadcrumbItem>
  <BreadcrumbItem href="/a/b/c">Projects</BreadcrumbItem>
  <BreadcrumbItem href="/a/b/c/d">Website</BreadcrumbItem>
  <BreadcrumbItem isCurrent>Settings</BreadcrumbItem>
</Breadcrumbs>

Icon in a crumb

A crumb's children can include an icon — a home glyph on the root is the common case.

<Breadcrumbs aria-label="Breadcrumb with icon">
  <BreadcrumbItem href="/">
    <HomeIcon /> Home
  </BreadcrumbItem>
  <BreadcrumbItem href="/team">Team</BreadcrumbItem>
  <BreadcrumbItem isCurrent>Ada Lovelace</BreadcrumbItem>
</Breadcrumbs>

Example

breadcrumbs.tsx
<Breadcrumbs>
  <BreadcrumbItem href="/">Home</BreadcrumbItem>
  <BreadcrumbItem href="/reports">Reports</BreadcrumbItem>
  <BreadcrumbItem>Q3 revenue</BreadcrumbItem>
</Breadcrumbs>

Props

The full public API for Breadcrumbs. Every prop is stable and intentionally typed.

Appearance

separator

ReactNode

default: chevron

Rendered between items.

Behavior & states

maxItems

number

default: —

Collapse the middle into a clickable … once exceeded.

itemsBeforeCollapse

number

default: 1

Leading items kept when collapsed.

itemsAfterCollapse

number

default: 2

Trailing items kept when collapsed.

href

string

default: —

Renders an <a>.

isCurrent

boolean

default: last item

Render as current-page text with aria-current.

as

ElementType

default: "a" / "span"

Render the link as another component (router Link).

Styling

classNames

{ base?, list?, item?, separator? }

default: —

Slot class overrides.

Accessibility

  • Wrapped in `<nav aria-label="Breadcrumb">` with an ordered list.
  • The current page is the last item, is not a link, and carries `aria-current="page"`.
  • Separators are generated in CSS so they are never read aloud.