Navigation/Breadcrumb

Breadcrumb

Displays the path to the current resource using a hierarchy.

Themed

When to Use

Use Breadcrumb when you need to:

  • Show the user their current location within a site hierarchy
  • Provide quick navigation back to parent pages or sections
  • Reveal the structure of deeply nested content (3+ levels)
  • Supplement primary navigation with contextual wayfinding
  • Help users orient themselves after arriving via search or deep link

When Not to Use

  • Single-level navigation - breadcrumbs add no value when there is no hierarchy
  • Primary navigation replacement - use Navigation Menu or Sidebar instead
  • Step-by-step wizards - use Tabs or a stepper component for linear flows
  • Paginated content - use Pagination for sequential page navigation

Default

Breadcrumb with collapsed items shown in a dropdown menu.

Simple

Basic breadcrumb with links and a current page indicator.

Custom Separator

Replace the default chevron with a custom separator character or icon.

Collapsed

Use BreadcrumbEllipsis to represent hidden intermediate levels in deep hierarchies.

With Dropdown

Compose with DropdownMenu to let users explore sibling pages at any level.

UX & Design Guidelines

Visual Hierarchy

Breadcrumbs are secondary navigation and should not compete with the primary nav. Place them at the top of the page content area, below the header but above the page title. Keep text size small (text-sm) and use text-muted-foreground for ancestor links so the current page stands out in text-foreground.

Spacing & Layout

The default gap-1.5 (mobile) and sm:gap-2.5 (desktop) provide comfortable spacing between items. Avoid adding extra margin or padding around the breadcrumb container; it should sit flush with the content below. When paths are very long, the component wraps naturally thanks to flex-wrap.

Responsive Behavior

On mobile screens, collapse intermediate levels using BreadcrumbEllipsis to keep the breadcrumb on a single line. Show only the root, an ellipsis, the parent, and the current page. On wider screens, reveal the full hierarchy. Consider hiding breadcrumbs entirely on very small screens where the sidebar already shows hierarchy.

Color & Contrast

Ancestor links use text-muted-foreground with a hover:text-foreground transition for interactive feedback. The current page uses text-foreground to clearly distinguish it from clickable ancestors. Separators inherit the muted foreground color so they recede visually. All interactive states meet WCAG 2.1 AA contrast requirements.

Accessibility

Keyboard Navigation

  • Tab — Move focus to the next breadcrumb link
  • Shift + Tab — Move focus to the previous breadcrumb link
  • Enter — Activate the focused link (navigate)
  • When a DropdownMenu is used, Space or Enter opens the menu
  • Escape — Close an open dropdown menu

Screen Reader Support

  • The root renders a <nav> element with aria-label="breadcrumb"
  • Items use an ordered list (<ol>) so screen readers announce the count and position
  • The current page is marked with aria-current="page"
  • BreadcrumbEllipsis includes a visually hidden "More" label for screen readers

Semantic Structure

Separators are rendered with role="presentation" and aria-hidden="true" so they are invisible to assistive technology. The ellipsis uses the same pattern. This ensures screen readers announce only the meaningful links and current page, not decorative elements.

Focus Management

Links receive a visible focus ring via focus-visible styles. The current page (BreadcrumbPage) has aria-disabled="true" and is not focusable, preventing users from tabbing to a non-interactive element.

ARIA Attributes

{/* Breadcrumb uses a semantic <nav> with aria-label */}
<Breadcrumb>
  <BreadcrumbList>
    <BreadcrumbItem>
      <BreadcrumbLink href="/">Home</BreadcrumbLink>
    </BreadcrumbItem>
    <BreadcrumbSeparator />
    {/* Current page is marked with aria-current="page" */}
    <BreadcrumbItem>
      <BreadcrumbPage>Settings</BreadcrumbPage>
    </BreadcrumbItem>
  </BreadcrumbList>
</Breadcrumb>

{/* Separators are decorative and hidden from screen readers */}
<BreadcrumbSeparator />
{/* Renders: <li role="presentation" aria-hidden="true"> */}

{/* Ellipsis is also hidden from assistive technology */}
<BreadcrumbEllipsis />
{/* Renders: <span role="presentation" aria-hidden="true">
     with <span className="sr-only">More</span> */}

API Reference

The Breadcrumb component is composed of several sub-components. Each accepts standard HTML attributes in addition to the props listed below.

Breadcrumb

PropTypeDefaultDescription
childrenReact.ReactNodeThe breadcrumb content (typically a BreadcrumbList).
classNamestringAdditional CSS classes for the root nav element.

BreadcrumbList

PropTypeDefaultDescription
childrenReact.ReactNodeBreadcrumbItem and BreadcrumbSeparator elements.
classNamestringAdditional CSS classes for the ordered list.

BreadcrumbItem

PropTypeDefaultDescription
childrenReact.ReactNodeA BreadcrumbLink, BreadcrumbPage, or BreadcrumbEllipsis.
classNamestringAdditional CSS classes for the list item.

BreadcrumbLink

PropTypeDefaultDescription
hrefstringThe URL to navigate to when clicked.
asChildbooleanfalseWhen true, merges props onto child element (e.g. for Next.js Link).
classNamestringAdditional CSS classes for the anchor element.

BreadcrumbPage

PropTypeDefaultDescription
childrenReact.ReactNodeThe text for the current page.
classNamestringAdditional CSS classes for the current page span.

BreadcrumbSeparator

PropTypeDefaultDescription
childrenReact.ReactNode<ChevronRight />Custom separator content (replaces default chevron icon).
classNamestringAdditional CSS classes for the separator.

BreadcrumbEllipsis

PropTypeDefaultDescription
classNamestringAdditional CSS classes for the ellipsis container.