Skip to content
shadcn.io is not affiliated with official shadcn/ui

Shadcn Breadcrumb for React and Tailwind

Shows the current page in a hierarchy.

Installation

bunx --bun shadcn@latest add https://kit.dev/r/breadcrumb.json

Anatomy

BreadcrumbSeparator is a sibling of BreadcrumbItem, not nested inside it. BreadcrumbEllipsis sits inside an item when middle segments are collapsed.

Breadcrumb
└── BreadcrumbList
    ├── BreadcrumbItem
    │   └── BreadcrumbLink | BreadcrumbPage | BreadcrumbEllipsis
    └── BreadcrumbSeparator

Usage

import {
  Breadcrumb,
  BreadcrumbItem,
  BreadcrumbLink,
  BreadcrumbList,
  BreadcrumbPage,
  BreadcrumbSeparator,
} from "@/components/ui/breadcrumb";
<Breadcrumb>
  <BreadcrumbList>
    <BreadcrumbItem>
      <BreadcrumbLink href="/">Home</BreadcrumbLink>
    </BreadcrumbItem>
    <BreadcrumbSeparator />
    <BreadcrumbItem>
      <BreadcrumbLink href="/components">Components</BreadcrumbLink>
    </BreadcrumbItem>
    <BreadcrumbSeparator />
    <BreadcrumbItem>
      <BreadcrumbPage>Breadcrumb</BreadcrumbPage>
    </BreadcrumbItem>
  </BreadcrumbList>
</Breadcrumb>

The last segment is BreadcrumbPage (the current page), not a link.

Examples

Custom separator

Pass children to BreadcrumbSeparator. The default is a chevron that flips in RTL.

Use asChild on BreadcrumbLink to render Link (or another router link).

With icon

Icon-only crumbs need aria-label on the link. Decorative icons should be aria-hidden="true".

Collapsed

Replace middle items with BreadcrumbEllipsis. Add a visually hidden label on that item so the gap is announced.

With menu

Compose Menu with the ellipsis so collapsed items stay reachable.

Guides

asChild

asChild comes from Ark’s factory. Merge BreadcrumbLink onto a single child:

<BreadcrumbLink asChild>
  <Link href="/docs">Docs</Link>
</BreadcrumbLink>

Collapsing long trails

Keep the first crumb, the current page, and one parent. Hide the rest behind BreadcrumbEllipsis. If the ellipsis is not inside a labeled control, put sr-only text on the item.

Separators

Separators are presentational lis (role="presentation", aria-hidden). They do not count as destinations. Default chevron uses rtl:rotate-180. A slash icon does not need to flip.

BreadcrumbTabsBottom Navigation
RoleWhere you are in a hierarchyPanels in one pagePrimary app destinations
Typical controlLinks + current pageTab triggersIcon + label items

API Reference

shadcn.io Breadcrumb is composed nav / ol / li (Ark factory), not a Zag machine. There is no context hook or root provider.

asChild merges props onto a single child element.

Landmark. Renders a nav.

PropTypeDefaultDescription
aria-labelstring"Breadcrumb"Accessible name of the landmark.
asChildbooleanfalseRender the child element instead of a nav.
classNamestring-Class names on the root.
AttributeDescription
data-slotbreadcrumb
aria-label"Breadcrumb" unless overridden

Ordered list of segments. Renders an ol.

PropTypeDefaultDescription
asChildbooleanfalseMerge onto a single child.
classNamestring-Class names on the list.
AttributeDescription
data-slotbreadcrumb-list
rolelist

Wraps at flex-wrap. Spacing is gap-1.5 (sm:gap-2.5). Text is text-sm text-muted-foreground.

One segment. Renders an li.

PropTypeDefaultDescription
asChildbooleanfalseMerge onto a single child.
classNamestring-Class names on the item.
AttributeDescription
data-slotbreadcrumb-item

Link to an ancestor. Renders an a.

PropTypeDefaultDescription
hrefstring-Destination. Prefer asChild + router Link in Next.js.
asChildbooleanfalseMerge onto a single child (Link, a).
classNamestring-Class names on the link.

Native link attributes (target, rel, aria-label, …) pass through.

AttributeDescription
data-slotbreadcrumb-link

Current page. Renders a span. Not a link.

PropTypeDefaultDescription
asChildbooleanfalseMerge onto a single child.
classNamestring-Class names on the page label.
AttributeDescription
data-slotbreadcrumb-page
aria-currentpage

Presentational divider between items. Renders an li. Default child is ChevronRightIcon (flips in RTL).

PropTypeDefaultDescription
childrenReactNodechevronCustom separator. Icons inherit size-4.
asChildbooleanfalseMerge onto a single child.
classNamestring-Class names on the separator.
AttributeDescription
data-slotbreadcrumb-separator
rolepresentation
aria-hiddentrue

Collapsed-middle marker. Renders a span. Decorative (aria-hidden). Put an accessible name on the parent item or a wrapping button.

PropTypeDefaultDescription
asChildbooleanfalseMerge onto a single child.
classNamestring-Class names on the ellipsis.
AttributeDescription
data-slotbreadcrumb-ellipsis
rolepresentation
aria-hiddentrue

Props of Breadcrumb: nav attributes plus optional aria-label.

Accessibility

Complies with the Breadcrumb WAI-ARIA pattern. The root is a nav labeled "Breadcrumb". The current page uses aria-current="page" and is not a link.

  • Icon-only links: aria-label on BreadcrumbLink. Decorative icons: aria-hidden="true".
  • Ellipsis: keep aria-hidden on BreadcrumbEllipsis. Name the wrapping item (sr-only) or button (aria-label).
  • Separators are hidden from the accessibility tree.

Keyboard support

The trail is not a composite widget. Links participate in the normal tab order.

KeyDescription
TabMove to the next link (or menu trigger).
Shift + TabMove to the previous link.
EnterFollow the focused link, or open the ellipsis menu.
SpaceActivate a button ellipsis trigger.
Arrow keysMove inside an open Menu, not along the trail.