Skip to content

Shell breadcrumbs

Route-based breadcrumb trail for the app shell. Parses usePathname() and maps path segments to human-readable labels via a consumer-provided resolveLabel function, or accepts an explicit segments override.

Installation

First install? Complete the one-time host setup.

Live preview

A route-based breadcrumb trail from Next.js usePathname(), or an explicit segments list. Switch Depth to see shallow, deep, and ellipsis-collapsed trails.

Loading preview…

Built with Breadcrumb.

Props

PropTypeDefaultDescription
segmentsBreadcrumbSegment[]Explicit segment list. When provided `resolveLabel` and `usePathname` are bypassed. Each segment has a `label` string and an optional `href`.
resolveLabel(segment: string, fullPath: string) => string | null | Promise<string | null>Consumer-provided label resolver for dynamic path segments. Return `null` to fall back to the capitalized raw segment. May be async (e.g. entity name fetch).
maxVisiblenumber4Maximum number of crumbs shown before collapsing the middle ones with an ellipsis. Click the ellipsis to expand.
showHomebooleantruePrepend a home icon crumb as the first item.
homeHrefstring'/'Href for the home icon crumb.
messagesShellBreadcrumbsMessageOverridesOverride any UI copy — `homeAriaLabel`, `ellipsisAriaLabel`, `navAriaLabel`, and per-code `errors`.
onError(err: unknown) => voidFires when an async `resolveLabel` call throws. The segment falls back to the capitalized raw value.
classNamestringExtra class names on the root `<nav>` element.

Messages

copy

KeyDefault copy
homeAriaLabelHome
ellipsisAriaLabelShow more breadcrumbs
navAriaLabelBreadcrumb

errors

CodeDefault copy
UNKNOWN_ERRORSomething went wrong. Please try again.