Skip to documentation

Design system / Molecules

Molecule / Navigation

BreadcrumbTrail

BreadcrumbTrail renders supplied hierarchy items as ancestor links or current-page text on one horizontally scrollable line. Complete labels remain available; keyboard focus brings ancestor links into view. It does not parse the URL or infer the current item from its position. The caller supplies a coherent hierarchy.

Live example

Live preview

Current component with fictional data. Example changes are not persisted.

Responsibility

The trail presents one hierarchy through ancestor links and current-page text. TopNav combines it with branding, menus and other navigation concerns, making TopNav an organism. The caller supplies hierarchy data.

Public contract

The table describes supported inputs, exported parts and caller responsibilities. A callback supplies a command, such as saving a draft. These notes are maintained manually; check current source types before integration.

Maintained component API notes; current source is authoritative
Prop / partTypeRequirementResponsibility
itemsBreadcrumbItem[]RequiredEach item has label: string, href?: string, isCurrent?: boolean.
classNamestringOptionalPassed to Breadcrumb; not a per-item style API.
href + !isCurrentLink-rendering conditionObserved branchOnly these items are links; all other items render BreadcrumbPage. Last position alone does not decide current status.

API notes are curated documentation, not generated types. The source linked above is the current implementation; update these notes alongside API changes.

State and behavior

Identify which values the caller controls and which behavior the component or underlying primitive owns. A local example does not supply persistence, authorization or a complete product lifecycle.

No local state, hook or URL parser. The consumer supplies items and paths. Next Link owns navigation in the source application; routes remain authorization boundaries. This trail does not infer the path from the current URL.

Dependencies

  • Breadcrumb, BreadcrumbList, BreadcrumbItem, BreadcrumbLink, BreadcrumbPage, BreadcrumbSeparator
  • Next.js Link
  • Lucide ChevronRight
  • React Fragment
  • navigation/types BreadcrumbItem

Token and styling contract

These notes identify theme roles, utilities and direct style values used by the source. Direct colors or timings are implementation exceptions, not recommendations to bypass the theme.

text-muted-foreground / text-foreground
Ancestor list and current page roles from Breadcrumb primitives.
text-md / gap-1.5 / sm:gap-2.5
Single-line list typography and spacing. The navigation wrapper contains horizontal scrolling; complete labels and native links remain available.
hover:text-foreground
Ancestor hover feedback from BreadcrumbLink.
size-3.5
Separator icon sizing from the primitive.

Boundaries and limitations

  • No automatic final-item detection, collapse, back history or authorization.
  • Missing href and explicit isCurrent both select BreadcrumbPage; malformed data can mark multiple items current.
  • Labels form part of Fragment keys. Consumer data should avoid duplicate label/href pairs.
  • No per-item className or external-link policy is exposed by the wrapper.

Where to make a change

Change common trail assembly in breadcrumbTrail.tsx; change approved path data and labels in consumers. Shared Breadcrumb changes propagate. Keep current-page semantics coherent and do not move route authorization into navigation.

Selected real uses

TopNav

Renders BreadcrumbTrail when items are supplied. The product header hides the trail below its md breakpoint; the isolated documentation example stays visible on mobile.

src/components/navigation/topNav.tsx

Individual review page

Supplies the review-round link and current submission title. The route groups the trail with ContentHeading using a compact 12px gap; it stays visible on mobile and does not infer browser history.

Repository path: src/app/(tenants)/console/[tenantCode]/programs/[programCode]/editions/[editionCode]/rounds/[roundCode]/[submissionCode]/page.tsx

These traces describe selected uses, not every dependency. Repository-only paths are shown as references; only approved files have public source views.

Usage contract

import { BreadcrumbTrail } from "@/components/navigation/breadcrumbTrail";

<BreadcrumbTrail items={[
  { label: "Console", href: consolePath },
  { label: "Program", href: programPath },
  { label: "Settings", isCurrent: true },
]} />

Illustrative consumer bindings, not a self-contained product workflow. Live examples supply only local state or explicit fictional props.

All molecules
Current components and theme tokens. Fictional example data. Source views refresh on deployment; authors maintain contract notes.