Breadcrumb
A page trail with one fluid hover across every crumb, dropdown steps, and collapsed middles.
Installation
This component is primitive-agnostic — same source under both flavors.
Basic
The highlight is one element shared by the whole trail: move along the crumbs and it glides from one to the next instead of blinking off in the gaps. The last crumb is the current page and is announced with aria-current="page".
Separator and icon
The separator lives inside each crumb, so the hover covers it and the crumbs sit flush. Pass separator={null} to remove it entirely.
Dropdown step
A step with siblings can open a menu instead of navigating. While the menu is open the crumb keeps foreground text and its chevron points down; both states read from the props the primitive puts on the trigger.
Collapse the middle
useBreadcrumbCollapse measures the trail and hides middle steps until it fits, keeping the first crumb, the last link and the current page. Give the Breadcrumb a bounded width — in a flex header, flex-1 min-w-0.
API Reference — Breadcrumb
| Prop | Type | Default | Description |
|---|---|---|---|
| size | "default" | "compact" | from SizeProvider | Pins the trail to one size step. Default crumbs are 28px with 13px text; compact is 24px with 12px. |
| separator | ReactNode | null | chevron-right | The trailing glyph of every crumb but the last. null removes it; a custom glyph replaces the chevron. |
| aria-label | string | "Breadcrumb" | Labels the navigation landmark. |
| ...props | HTMLAttributes<HTMLElement> | — | Applied to the nav, which owns the trail's fluid hover scope. |
API Reference — BreadcrumbLink
| Prop | Type | Default | Description |
|---|---|---|---|
| href | string | — | The destination of the crumb. |
| render | ReactElement | — | Renders a different element instead of <a>, such as a framework link. |
| asChild | boolean | false | shadcn-style composition: the single child element becomes the link. |
| ...props | AnchorHTMLAttributes | — | All native anchor attributes. Long labels truncate at 12rem (10rem compact); pass max-w-* to change the cap. |
API Reference — BreadcrumbButton
| Prop | Type | Default | Description |
|---|---|---|---|
| type | "button" | "submit" | "reset" | "button" | Native button type. |
| ...props | ButtonHTMLAttributes | — | All native button attributes. Pass it to a DropdownTrigger's render prop to open a menu from a step. |
useBreadcrumbCollapse
| Prop | Type | Default | Description |
|---|---|---|---|
| count | number | — | Total number of steps, including the current page. |
| enabled | boolean | true | When false, nothing is hidden — for a trail the reader expanded. |
| listRef | Ref<HTMLOListElement> | — | Attach to BreadcrumbList. The hook measures it against its Breadcrumb. |
| hidden | number | — | How many steps to hide, starting from the second. Render an ellipsis in their place. |
Parts
| Prop | Type | Default | Description |
|---|---|---|---|
| BreadcrumbList | ol | — | Lays the crumbs out in one row and holds the current page's truncation. |
| BreadcrumbItem | li | — | Holds one crumb. Only the item with the current page is allowed to shrink. |
| BreadcrumbPage | span | — | The current page: foreground text, aria-current=page, and the one crumb that truncates. |
| BreadcrumbEllipsis | span | — | The collapsed middle. Put it in a named BreadcrumbButton. |