Skip to content

Now in the official shadcn registry directory.

Start free

Breadcrumb

An accessible trail of links to the current page, with aria-current on the active crumb and swappable separators.

navigation
A free styled version is available

Installation

Run the following command

npx shadcn@latest add @ai2/breadcrumb

Dependencies, the @ai2/tokens theme and the component file are installed together.

Usage

TS
import {
  Breadcrumb,
  BreadcrumbItem,
  BreadcrumbLink,
  BreadcrumbList,
  BreadcrumbPage,
  BreadcrumbSeparator,
} from "@/components/ui/breadcrumb"

<Breadcrumb>
  <BreadcrumbList>
    <BreadcrumbItem>
      <BreadcrumbLink href="/">Home</BreadcrumbLink>
    </BreadcrumbItem>
    <BreadcrumbSeparator />
    <BreadcrumbItem>
      <BreadcrumbPage>Settings</BreadcrumbPage>
    </BreadcrumbItem>
  </BreadcrumbList>
</Breadcrumb>

Use BreadcrumbLink for ancestors and BreadcrumbPage for the current page, which renders a non-interactive span with aria-current="page".

Examples

Custom separator

BreadcrumbSeparator renders a chevron by default; pass any icon as children to replace it.

Collapsed

Use BreadcrumbEllipsis to collapse long trails; it stays hidden from screen readers apart from an sr-only "More" label.

As child

Props

Every part renders a plain semantic element (nav, ol, li, a, span) and accepts its native props. The only extra prop is on BreadcrumbLink.

PropTypeDefaultDescription
asChildbooleanfalseMerges props onto the child element (e.g. a router Link) instead of rendering a native anchor.

ai2 Breadcrumb: accessible navigation trails for React

The ai2 Breadcrumb is a shadcn-compatible react breadcrumb component styled with Tailwind CSS v4. It renders the path to the current page as a semantic nav landmark with an ordered list inside, so users (and search engines) can see where they are and jump back up the hierarchy. Docs sites, dashboards, file browsers and e-commerce category pages are the classic homes for it.

It ships through the shadcn registry format, so you install it with one CLI command, an MCP agent, or a copy-paste, and the TypeScript source lands in your own project. You own the file; there is no runtime dependency on ai2 itself. The live example above is the exact component you get.

What is the ai2 Breadcrumb?

It is a seven-part composition matching shadcn/ui: Breadcrumb, BreadcrumbList, BreadcrumbItem, BreadcrumbLink, BreadcrumbPage, BreadcrumbSeparator and BreadcrumbEllipsis. Each part renders a plain semantic element: nav, ol, li, a and span.

Accessibility is baked into the markup. The root nav carries aria-label="breadcrumb", the current page renders as a non-interactive span with aria-current="page", separators are hidden from assistive technology with aria-hidden and role="presentation", and the ellipsis exposes an sr-only "More" label. There is no radix primitive here because plain HTML semantics already do the job.

Why use it

  • Correct a11y markup out of the box: aria-label="breadcrumb" on the nav, aria-current="page" on the active crumb and aria-hidden separators follow the WAI-ARIA breadcrumb pattern, so screen readers announce the trail correctly with zero configuration.
  • Router-agnostic links: BreadcrumbLink renders a plain anchor by default and accepts asChild to merge onto a Next.js Link or any router's component, keeping client-side navigation intact.
  • Swappable separators: The chevron default can be replaced per separator by passing children (a Slash, a dot, custom svg), and the change stays invisible to assistive technology.
  • Built-in trail collapsing: BreadcrumbEllipsis gives long paths the standard collapsed middle without inventing your own overflow logic.
  • Agent-readable metadata: The registry item describes the parts and intended use in plain words, so an MCP agent can find, inspect and install it without guessing.

Features

  • Semantic nav plus ordered list: The trail is a real nav landmark wrapping an ol, so document outlines, crawlers and assistive technology all read the hierarchy natively.
  • aria-current on the active crumb: BreadcrumbPage renders a non-interactive span with aria-current="page" and aria-disabled, clearly separating the current location from the links.
  • Custom separators: BreadcrumbSeparator renders a ChevronRight by default; pass any icon as children to replace it, per separator or across the trail.
  • Ellipsis for long trails: BreadcrumbEllipsis renders a horizontal-dots icon with an sr-only "More" label, hidden from screen readers as decoration.
  • Focus-visible ring on links: Every BreadcrumbLink keeps the shared ai2 focus ring and a token-driven hover transition, matching interactive elements across the system.
  • Data attributes for styling: Every part exposes data-slot (breadcrumb, breadcrumb-list, breadcrumb-link and so on) for targeted CSS overrides without forking.

Production tips

  • Always end with BreadcrumbPage: The last crumb should be the current page as a span, not a link. A self-link confuses users and wastes the aria-current semantics the component provides.
  • Use asChild with your router: In Next.js, wrap Link with BreadcrumbLink asChild so navigation stays client-side. A plain href causes a full page load.
  • Collapse from the middle: Keep the first crumb (Home or the root) and the last one or two levels visible, and put BreadcrumbEllipsis between them. The edges carry the most information.
  • Keep labels short: Crumbs are wayfinding, not titles. Truncate long entity names with a max-width and text-ellipsis on the specific crumb rather than letting the trail wrap twice.
  • One breadcrumb per page: The nav is labeled "breadcrumb"; two of them create duplicate landmarks. If sub-areas need their own trail, merge it into the single top trail instead.

Works with the rest of ai2

Breadcrumbs usually sit in the page header next to an ai2 Avatar or workspace switcher, with an ai2 Badge after the current crumb for statuses like Draft. A ai2 Dropdown Menu can hang off the ellipsis to expose the collapsed levels as a menu.

For deep drill-downs, pair the trail with ai2 Pagination at the bottom of list pages, and use an ai2 Separator to divide the header from content. Everything shares one token source, so the muted trail matches the rest of your chrome in both modes.

FAQs

Get new components in your inbox

Component drops, new themes and release notes. No spam, and you can unsubscribe from any email.

© 2026 ai2 design system · MIT licensed · Built with its own components