Breadcrumbs
Hierarchical navigation that shows the current location within an application or website.
Breadcrumbs help users understand where they are in a hierarchy and quickly return to a parent location. Each item can be a link, an action, a disabled label, or the current page. The component renders semantic navigation with an ordered list and accessible current-page state.
Basic usage
Provide an ordered items array. Mark the current location with current: true; when no item is marked current, the last item is treated as current automatically.
const items = [
{ label: 'Workspace', href: '/workspace' },
{ label: 'Projects', href: '/workspace/projects' },
{ label: 'Website redesign', current: true },
];
<Breadcrumbs items={items} />The current item is rendered as a non-link with aria-current="page". Parent items become links using their href values.
Home, icons, and separators
Set showHome to prepend a home link. Use homeIcon, item icon, or a custom separator to match the navigation language of the product:
<Breadcrumbs
showHome
separator="/"
items={[
{ label: 'Documentation', href: '/docs' },
{ label: 'Components', href: '/docs/components' },
{ label: 'Breadcrumbs', current: true },
]}
/>separator accepts any ReactNode, including an icon or a short text character. homeIcon replaces the default home icon.
Long paths
Use maxItems to collapse the middle of a long path. The first and last items remain visible and the middle is replaced with an accessible button. Selecting it expands the full path:
<Breadcrumbs items={items} maxItems={4} expandLabel="Show complete path" />Paths with two or fewer items are never collapsed. The component keeps the full list available to keyboard and assistive-technology users after expansion.
Sizes and visual variants
size supports xs (extra small), sm (small), and default. The default size uses a 14px font. variant="muted" reduces emphasis on the current item, while variant="pill" gives each item a filled control surface:
<Breadcrumbs size="default" items={items} />
<Breadcrumbs size="sm" variant="muted" items={items} />
<Breadcrumbs size="xs" items={items} />Hover effects
Breadcrumb links use a filled background on hover by default. The effects are independent parameters, so a consumer can keep the background, replace it with an underline, or add button-like movement:
<Breadcrumbs items={items} hoverBackground />
<Breadcrumbs items={items} hoverBackground={false} hoverUnderline />
<Breadcrumbs items={items} hoverBackground={false} hoverLift />hoverBackgroundshows the filled background on hover and defaults totrue.hoverUnderlineunderlines the item on hover and defaults tofalse.hoverLiftmoves the item up slightly on hover and returns it on press, matching the button interaction, and defaults tofalse.
The effects can be combined. They apply to clickable breadcrumb links and the expandable ellipsis control.
Actions and custom rendering
Use an item's onClick or the shared onItemClick callback when a breadcrumb needs application behavior instead of ordinary navigation. Call event.preventDefault() in the callback when preventing the browser navigation is necessary.
<Breadcrumbs
items={items}
onItemClick={(item, index, event) => {
analytics.track('breadcrumb_click', { index, label: item.label });
event.preventDefault();
}}
/>renderItem replaces the default item rendering and receives the item, its original index, and whether it is current. Use it for badges, custom links, router integrations, or special visual states. The separator is still rendered by Breadcrumbs.
Current labels and disabled items
currentLabel replaces the label of the last item without changing the source array. This is useful when the current title is loaded asynchronously. Set disabled on an item when it should remain visible but cannot be activated.
<Breadcrumbs
currentLabel="Loading document…"
items={[
{ label: 'Documents', href: '/documents' },
{ label: 'Quarterly report', current: true },
]}
/>Accessibility
The component renders a nav landmark with an ordered list. Supply a more specific aria-label when a page has multiple navigation landmarks. The current item uses aria-current="page", separators are hidden from assistive technology, and links and expansion controls have visible focus styles.
API Reference
| Property | Type | Default | Description |
|---|---|---|---|
items | BreadcrumbItem[] | required | Ordered breadcrumb entries. |
showHome | boolean | false | Adds a link to / before the items. |
homeIcon | ReactNode | home icon | Icon rendered by the home link. |
separator | ReactNode | chevron icon | Content between items. |
maxItems | number | — | Collapses the middle when the path is longer than this value. |
expandLabel | string | Show all breadcrumbs | Accessible label for the collapsed-path button. |
ellipsisLabel | ReactNode | ellipsis icon | Content of the collapsed-path button. |
currentLabel | ReactNode | — | Replacement label for the last item. |
onItemClick | (item, index, event) => void | — | Shared callback for clickable items. |
renderItem | (item, index, current) => ReactNode | — | Custom item renderer. |
aria-label | string | Breadcrumbs | Accessible name for the navigation landmark. |
size | xs | sm | default | default | Breadcrumb typography and spacing. default uses a 14px font. |
variant | default | muted | pill | default | Visual treatment. |
hoverBackground | boolean | true | Shows the filled background on hover. |
hoverUnderline | boolean | false | Underlines the item on hover. |
hoverLift | boolean | false | Lifts the item on hover and returns it on press. |
className | string | — | Additional class on the navigation element. |
id | string | — | Navigation element ID. |
BreadcrumbItem
| Property | Type | Description |
|---|---|---|
label | ReactNode | Visible item content. |
href | string | Destination for non-current items. |
icon | ReactNode | Leading decorative content. |
current | boolean | Marks the current page. |
disabled | boolean | Displays the item without interaction. |
onClick | (event) => void | Item-specific click handler. |
Theme tokens
Breadcrumbs uses shared tokens for typography, surfaces, borders, focus, and icons. Component-only layout rules are kept in Breadcrumbs.css.
| Token | Purpose |
|---|---|
--mm-color-text | Current item and hover text. |
--mm-color-muted-text | Parent links and muted variant. |
--mm-color-control-icon | Separators and default icons. |
--mm-color-control-filled | Link hover and pill surfaces. |
--mm-color-control-selected | Pill hover surface. |
--mm-color-focus | Keyboard focus ring. |
--mm-radius-control | Link and button radius. |
--mm-font-family-sans | Breadcrumb typography. |