Breadcrumb
StableShows where the current page sits in the hierarchy and gives one-click access to every level above it.
Anatomy
- 1LinkAn ancestor level. Uses the destination page's title.
- 2SeparatorA quiet slash by default; hidden from assistive technology.
- 3Current pageThe last item. Not a link, marked with
aria-current="page".
Installation
$ pnpm dlx shadcn@latest add https://www.prfct.dev/r/breadcrumb.jsonUsage
import Link from "next/link"
import {
Breadcrumb,
BreadcrumbItem,
BreadcrumbLink,
BreadcrumbList,
BreadcrumbPage,
BreadcrumbSeparator,
} from "@/components/ui/breadcrumb"<Breadcrumb>
<BreadcrumbList>
<BreadcrumbItem>
<BreadcrumbLink render={<Link href="/docs" />}>Docs</BreadcrumbLink>
</BreadcrumbItem>
<BreadcrumbSeparator />
<BreadcrumbItem>
<BreadcrumbPage>Breadcrumb</BreadcrumbPage>
</BreadcrumbItem>
</BreadcrumbList>
</Breadcrumb>BreadcrumbLink renders an <a> by default; pass your router's link through render to keep client-side navigation. The last item is a BreadcrumbPage — the current location, which is not a link.
Examples
Default
prfct separates levels with a light slash. It reads as a path, takes less space than a chevron, and stays quiet next to the links.
Custom separator
Pass any icon as the child of BreadcrumbSeparator. Chevrons suit settings and file hierarchies where the trail represents drilling down.
Collapsed
When a trail has more than four levels, keep the root and the last two, and collapse the middle into a Dropdown Menu behind an ellipsis. Nothing becomes unreachable.
With icons
A house icon can stand in for the root when the product name is already visible in the header — give it an aria-label. Icons in the middle of a trail should mark the type of a level, not decorate it.
Switcher
In apps, the last segment can double as a switcher between siblings — projects in a team, branches in a repo. The trigger keeps the look of the current page; the menu marks the active item.
Guidelines
When to use
- In hierarchies three or more levels deep — docs, file systems, settings, e-commerce categories.
- When people land deep in a structure from search or a shared link and need to orient themselves.
When not to use
- In flat sites with one or two levels — the page title is enough.
- To show a sequence of steps or history — breadcrumbs describe location, not the path someone took. Use a stepper for multi-step flows.
- As the primary navigation. Breadcrumbs complement a Sidebar or Navigation Menu; they don't replace them.
Content
Each item uses the destination page's title, shortened only if needed. Don't link the current page, don't repeat it right below as the page title in a different wording, and don't add a trailing separator.
Placement
Put the breadcrumb above the page title, left-aligned with it, in the page's content column. On narrow screens, collapse to the root and the parent level, or show only a Back to parent link.
Accessibility
- Landmark.
Breadcrumbrenders a<nav>labelled Breadcrumb (translated by LocaleProvider), so screen reader users can jump to it from the landmarks list. - Order. Items are an ordered list (
<ol>), which conveys the hierarchy and the number of levels. - Current page.
BreadcrumbPageis exposed as a disabled link witharia-current="page", so it's announced as the current location, and it isn't focusable. - Separators are
aria-hidden, so they aren't announced between levels. - Collapsed levels need a trigger with an accessible name, such as Show hidden path.
| Key | Behavior |
|---|---|
Tab | Moves focus through the links in order. The current page is skipped. |
Enter | Follows the focused link. |
API reference
Breadcrumb
The <nav> landmark. Accepts all <nav> props; override aria-label when a page has more than one breadcrumb.
BreadcrumbList and BreadcrumbItem
BreadcrumbList is the <ol> that lays out the trail and wraps on narrow screens. BreadcrumbItem is an <li> that aligns its content — a link, a page, or a menu trigger.
BreadcrumbLink
BreadcrumbPage
The current location. Renders a <span> with aria-current="page".
BreadcrumbSeparator
BreadcrumbEllipsis
A ⋯ glyph for collapsed levels, announced as More in the language set by LocaleProvider. Inside a trigger, give the trigger a name of its own that says what it reveals.