Overview
The Breadcrumb component provides a way to show users their current location within a website or application hierarchy. It helps users understand their position and navigate back to parent pages efficiently.Use cases
- Display navigation hierarchy in multi-level applications
- Help users understand their current location
- Provide quick navigation to parent pages
- Show page context in documentation sites
- Display file system paths in file managers
Anatomy
The Breadcrumb component is composed of several parts:Breadcrumb- Root container with navigation semanticsBreadcrumb.Item- Individual breadcrumb link or dropdownBreadcrumb.Separator- Visual separator between itemsBreadcrumb.Ellipsis- Collapsed items indicator
Props
Breadcrumb (root)
'small' | 'medium'
default:"'medium'"
Controls the size of the breadcrumb navigation.
string
Additional CSS class names to apply to the breadcrumb container.
Breadcrumb.Item
ReactNode
Icon to display before the breadcrumb label.
boolean
default:"false"
Indicates whether this item represents the current page. When true, the item is styled as active.
BreadcrumbDropdownItem[]
Array of dropdown menu items. When provided, the breadcrumb item becomes a dropdown menu trigger.Each item should have:
label(string) - The text to displayonClick(function, optional) - Click handler for the item
string
The URL to navigate to when the breadcrumb item is clicked.
ReactElement
Custom element to render instead of the default anchor tag. Useful for integration with routing libraries.
string
Additional CSS class names to apply to the breadcrumb item.
Breadcrumb.Separator
ReactNode
Custom separator content. Defaults to a chevron right icon.
string
Additional CSS class names to apply to the separator.
Breadcrumb.Ellipsis
ReactNode
Custom ellipsis content. Defaults to a horizontal dots icon.
string
Additional CSS class names to apply to the ellipsis.
Usage
Basic breadcrumb
With icons
With dropdown menu
Collapsed breadcrumb
Small size
With Next.js Link
Accessibility
- Uses semantic
<nav>and<ol>elements for proper navigation structure - Current page is indicated with the
currentprop for visual styling - Screen readers can identify the breadcrumb navigation context
- Keyboard navigable with standard tab navigation
- Works with custom routing libraries through the
asprop
Styling customization
The Breadcrumb component can be customized using theclassName prop on any of its parts: