Skip to content

Overlays & navigation

Breadcrumb

A breadcrumb shows where the current page sits in the hierarchy and links back up it. Each level is a link, the current page is plain text, and long paths collapse their middle into a “…” menu so the trail fits on one line, even on a phone.

On this page

Usage

components/ui/breadcrumb.tsx
import { Breadcrumb } from "@/components/ui/breadcrumb"; <Breadcrumb  items={[    { label: "Clients", href: "/clients" },    { label: "Fernhill Studio", href: "/clients/fernhill" },    { label: "INV-2041" },  ]}/>

Examples

Basic

The last item is the current page. Items can start with an icon.

Separators

A chevron (default), a slash, or any node you pass.

Collapsed

With maxItems, paths longer than that keep the first item and the last two; the rest move into a menu. The menu is a full Dropdown menu, so it works with the keyboard.

Props

  • itemsrequired{ label, href?, icon? }[]default: —From the top level down. The last item is the current page.
  • separator"chevron" | "slash" | ReactNodedefault: "chevron"What goes between items. Hidden from screen readers.
  • maxItemsnumberdefault: —Collapse the middle into a menu when there are more items than this.
  • classNamestringdefault: —Classes for the nav element.

Accessibility

  • Rendered as <nav aria-label="Breadcrumb"> with an ordered list, so screen readers announce the landmark and the number of levels.
  • The current page has aria-current="page" and is not a link.
  • Separators are presentational and hidden from assistive tech.
  • The “…” button is labelled with how many levels it hides and opens a menu of links that supports arrow keys and Escape.

Suggested