Breadcrumb

Shows where the current page sits in the site hierarchy.

Installation

pnpm dlx shadcn@latest add @paneui/breadcrumb

Usage

Composition

Examples

Custom Separator

Use a custom separator, like a slash, for file paths.

With Icons

Trail Options

Static Ellipsis

Use a static ellipsis when the hidden crumbs aren't worth navigating to.

Sizes

RTL

Motion

Each crumb fades and slides in 4px when it mounts, e.g. when navigating deeper. With reduced motion it appears at once.

Accessibility

Breadcrumb is a nav labelled "Breadcrumb". BreadcrumbPage is marked aria-current="page", and separators are hidden from screen readers.

API Reference

Breadcrumb

Also accepts every prop of nav.

aria-label= "Breadcrumb"
string
Accessible name of the nav.
PropTypeDefaultDescription
aria-labelstring"Breadcrumb"Accessible name of the nav.

BreadcrumbList

Wrapping row of crumbs. Also accepts every prop of ol.

size= "default"
"sm" | "default" | "lg"
Crumb height 24, 28 or 32px and text size, for every part inside.
PropTypeDefaultDescription
size"sm" | "default" | "lg""default"Crumb height 24, 28 or 32px and text size, for every part inside.
data-size
The size value.
Data attributeDescription
data-sizeThe size value.

BreadcrumbItem

One crumb; fades in on mount. Also accepts every prop of li.

A link crumb. Icons inside it, or inside BreadcrumbPage, are sized to 14px. Also accepts every prop of a.

render
ReactElement | (props, state) => ReactElement
Replace the <a>, e.g. with a router Link.
PropTypeDefaultDescription
renderReactElement | (props, state) => ReactElement—Replace the <a>, e.g. with a router Link.

BreadcrumbPage

The current page, with aria-current="page". Also accepts every prop of span.

BreadcrumbSeparator

Also accepts every prop of li.

children= <ChevronRightIcon />
ReactNode
Separator glyph.
PropTypeDefaultDescription
childrenReactNode<ChevronRightIcon />Separator glyph.

BreadcrumbEllipsis

The "…" crumb. With items it is a button that opens a menu of the hidden crumbs; without them it is a plain marker. Also accepts every prop of span.

items
{ label: ReactNode; href?: string; icon?: ReactNode; onClick?: () => void }[]
Hidden crumbs listed in the menu.
label= "Show hidden breadcrumbs"
string
Accessible name of the menu button.
PropTypeDefaultDescription
items{ label: ReactNode; href?: string; icon?: ReactNode; onClick?: () => void }[]—Hidden crumbs listed in the menu.
labelstring"Show hidden breadcrumbs"Accessible name of the menu button.
data-popup-open
Present on the menu button while its menu is open.
Data attributeDescription
data-popup-openPresent on the menu button while its menu is open.

BreadcrumbTrail

Renders a whole breadcrumb from items; the last item is the current page. Also accepts every prop of nav.

size= "default"
"sm" | "default" | "lg"
Passed to BreadcrumbList.
items*
{ label: ReactNode; href?: string; icon?: ReactNode; onClick?: () => void }[]
Crumbs from root to current page.
maxItems= 4
number
Collapse the middle once there are more items than this.
itemsBeforeCollapse= 1
number
Crumbs kept before the ellipsis.
itemsAfterCollapse= 2
number
Crumbs kept after the ellipsis.
separator
ReactNode
Replaces the chevron between crumbs.
PropTypeDefaultDescription
size"sm" | "default" | "lg""default"Passed to BreadcrumbList.
items*{ label: ReactNode; href?: string; icon?: ReactNode; onClick?: () => void }[]—Crumbs from root to current page.
maxItemsnumber4Collapse the middle once there are more items than this.
itemsBeforeCollapsenumber1Crumbs kept before the ellipsis.
itemsAfterCollapsenumber2Crumbs kept after the ellipsis.
separatorReactNode—Replaces the chevron between crumbs.