Breadcrumb
Shows where the current page sits in a hierarchy, with links to each ancestor.
import { Breadcrumb } from "@merid/react";
export function Example() {
return (
<Breadcrumb.Root>
<Breadcrumb.Item>
<Breadcrumb.Link href="#">Home</Breadcrumb.Link>
</Breadcrumb.Item>
<Breadcrumb.Item>
<Breadcrumb.Link href="#">Projects</Breadcrumb.Link>
</Breadcrumb.Item>
<Breadcrumb.Item>
<Breadcrumb.Page>Northwind</Breadcrumb.Page>
</Breadcrumb.Item>
</Breadcrumb.Root>
);
}Import
import { Breadcrumb } from "@merid/react";Anatomy
<Breadcrumb.Root>
<Breadcrumb.Item>
<Breadcrumb.Link href="/" />
</Breadcrumb.Item>
<Breadcrumb.Item>
<Breadcrumb.Page />
</Breadcrumb.Item>
</Breadcrumb.Root>Breadcrumb.Root— a<nav>landmark wrapping an ordered list.Breadcrumb.Item— one<li>in the trail. Separators are drawn between items in CSS.Breadcrumb.Link— an<a>to an ancestor page.Breadcrumb.Page— the current page as plain text witharia-current="page".
Examples
Long trail
The current page truncates with an ellipsis instead of wrapping when space runs out; give its item min-width: 0 inside a constrained width. The list itself wraps between items.
<Breadcrumb.Root aria-label="Settings location" style={{ maxWidth: 320 }}>
<Breadcrumb.Item>
<Breadcrumb.Link href="#">Settings</Breadcrumb.Link>
</Breadcrumb.Item>
<Breadcrumb.Item>
<Breadcrumb.Link href="#">Billing</Breadcrumb.Link>
</Breadcrumb.Item>
<Breadcrumb.Item style={{ minWidth: 0 }}>
<Breadcrumb.Page>Invoice INV-2026-000482 for September</Breadcrumb.Page>
</Breadcrumb.Item>
</Breadcrumb.Root>With a router
Breadcrumb.Link renders a plain <a> and does not take an as prop. For client-side routing, put your router's link inside Breadcrumb.Item and add className="mrd-breadcrumb__link" to it.
API reference
Breadcrumb.Root
Renders <nav> and accepts all its HTML attributes.
| Prop | Type | Default | Description |
|---|---|---|---|
aria-label | string | "Breadcrumb" | Accessible name of the landmark. |
ref | Ref<HTMLElement> | – | Forwarded ref to the nav element. |
Breadcrumb.Item
Renders <li> and accepts all its HTML attributes. No additional props.
Breadcrumb.Link
Renders <a> by default and accepts all anchor attributes. Pass as to render a router link instead; extra props such as to are forwarded.
| Prop | Type | Default | Description |
|---|---|---|---|
as | ElementType | "a" | Element or component to render, e.g. a router `Link`. |
href | string | – | Destination of the ancestor page. |
ref | Ref<HTMLAnchorElement> | – | Forwarded ref to the anchor. |
Breadcrumb.Page
Renders <span aria-current="page"> and accepts all its HTML attributes. No additional props.
Styling
.mrd-breadcrumb—navroot..mrd-breadcrumb__list— theol; a wrapping flex row at--mrd-text-xs..mrd-breadcrumb__item— eachli;.mrd-breadcrumb__item + .mrd-breadcrumb__item::beforedraws the/separator in--mrd-placeholder..mrd-breadcrumb__link— ancestor link in--mrd-body,--mrd-inkon hover..mrd-breadcrumb__page— current page in--mrd-ink, medium weight, single-line ellipsis.
The separator uses content: "/" / "", so it has empty alternative text and is not announced. To change it, override .mrd-breadcrumb__item + .mrd-breadcrumb__item::before in your own layer.
Accessibility
Follows the WAI-ARIA Breadcrumb pattern.
- The root is a
navlandmark named "Breadcrumb" by default. Rename it witharia-labelif the page has several navigation landmarks. - Items are an ordered list, so screen readers announce position and count.
- The last item uses
Breadcrumb.Page, which setsaria-current="page"and is not a link.
| Key | Action |
|---|---|
| Tab | Moves focus to the next link in the trail. |
| ShiftTab | Moves focus to the previous link. |
| Enter | Follows the focused link. |
Guidelines
Do
Avoid
Do
Avoid