Skip to content
IndexRequest a UIAboutContact

Breadcrumb

A hierarchy trail that collapses its middle levels into an expandable ellipsis.

Open alone ↗

AI prompt

PROMPT: PASTE INTO YOUR AI CODING TOOL
Build a breadcrumb navigation for a six-level path (Home / Library / Design / Components / Navigation / Breadcrumb) inside a nav element with aria-label="Breadcrumb" and an ordered list. Use chevron separators drawn with CSS and aria-hidden. When there are more than four levels, show only Home, an ellipsis button, and the last two levels. The ellipsis is a button with aria-label "Show hidden levels" and aria-expanded; clicking it reveals the hidden levels with a 160ms fade and 30ms stagger, then moves focus to the first revealed link. The last item is plain text with aria-current="page". Links are muted and underline on hover. Truncate very long labels with an ellipsis at 18ch. Disable animation for prefers-reduced-motion.

About this pattern

Definition

A horizontal trail of links that shows where the current page sits in a hierarchy, from the top level down to the current page. When the trail is long, the middle levels collapse into an ellipsis button that expands them.

Purpose & UX principles

  • Shows location and offers a quick way up several levels at once.
  • It is secondary navigation: it complements, but does not replace, the main navigation.
  • The last item is the current page; it is not a link and carries aria-current="page".

Interaction states

  • Link: muted, brightens on hover with an underline.
  • Collapsed: ellipsis button with aria-label="Show hidden levels" and aria-expanded="false".
  • Expanded: all levels visible, focus moves to the first revealed link.
  • Current: bright text, not clickable.

Motion specification

  • Revealed items fade in with a 30ms stagger, 160ms each.
  • Reduced motion: items appear immediately.

Responsive behaviour

  • On narrow screens keep only the first item, the ellipsis and the last two items.
  • Use a chevron separator, not a slash, so screen readers are not given extra noise (mark separators aria-hidden).

Code

HTML
<nav class="bc" aria-label="Breadcrumb">
  <ol id="bc">
    <li><a href="#">Home</a></li>
    <li class="mid" hidden><a href="#">Library</a></li>
    <li class="mid" hidden><a href="#">Design</a></li>
    <li class="mid" hidden><a href="#">Components</a></li>
    <li class="more"><button id="more" aria-label="Show hidden levels" aria-expanded="false">…</button></li>
    <li><a href="#">Navigation</a></li>
    <li><span aria-current="page">Breadcrumb</span></li>
  </ol>
</nav>
<p class="note">Click the ellipsis to reveal the hidden levels.</p>

Related patterns

Top Navigation

↗
Top NavigationNavigation

Pagination

↗
PaginationNavigation

Sidebar

↗
SidebarNavigation