Breadcrumb
Shows the user's location within a site hierarchy. A multi-part navigation landmark built from semantic HTML with no shared state between parts.
Installation#
Usage#
import {
Breadcrumb,
BreadcrumbList,
BreadcrumbItem,
BreadcrumbLink,
BreadcrumbPage,
BreadcrumbSeparator,
} from "@/components/ui/breadcrumb"
export function Example() {
return (
<Breadcrumb>
<BreadcrumbList>
<BreadcrumbItem>
<BreadcrumbLink href="/">Home</BreadcrumbLink>
</BreadcrumbItem>
<BreadcrumbSeparator />
<BreadcrumbItem>
<BreadcrumbPage>Dashboard</BreadcrumbPage>
</BreadcrumbItem>
</BreadcrumbList>
</Breadcrumb>
)
}Anatomy#
import {
Breadcrumb,
BreadcrumbList,
BreadcrumbItem,
BreadcrumbLink,
BreadcrumbPage,
BreadcrumbSeparator,
BreadcrumbEllipsis,
} from "@/components/ui/breadcrumb"
<Breadcrumb>
<BreadcrumbList>
<BreadcrumbItem>
<BreadcrumbLink />
</BreadcrumbItem>
<BreadcrumbSeparator />
<BreadcrumbItem>
<BreadcrumbEllipsis />
</BreadcrumbItem>
<BreadcrumbSeparator />
<BreadcrumbItem>
<BreadcrumbPage />
</BreadcrumbItem>
</BreadcrumbList>
</Breadcrumb>Custom separator#
Pass any content to BreadcrumbSeparator to replace the default caret - a text slash, a custom icon, or any node.
Collapsed#
Use BreadcrumbEllipsis inside a BreadcrumbItem to indicate hidden ancestors - a static indicator. To let users open the collapsed segments, swap it for the dropdown below.
Dropdown#
Make the collapsed segment interactive: drop a DropdownMenu into the BreadcrumbItem so the ellipsis opens a menu of the hidden ancestors - full keyboard navigation and focus management come from the underlying Radix primitive. The dots sit in a container that reveals its surface on hover and while open, so the collapsed crumb reads as a tappable control, with a 40px tap target.
Sibling navigation#
Turn the current crumb into the trigger: its label plus a caret that rotates on open, dropping a menu of sibling pages so users can jump sideways without going back up.
Grouped menu#
Compose the menu’s parts inside a breadcrumb - a DropdownMenuLabel, a DropdownMenuSeparator, and items that lead with an icon (auto-sized to size-4).
With icon#
Lead a crumb with an icon - keep it inline with the label and sized to the text (size-4) so the row stays on one baseline.
As child#
Use asChild on BreadcrumbLink to merge its styles onto a different element - e.g. a Next.js Link - via Radix Slot, with no extra wrapper.
import Link from "next/link"
import {
Breadcrumb, BreadcrumbList, BreadcrumbItem,
BreadcrumbLink, BreadcrumbSeparator, BreadcrumbPage,
} from "@/components/ui/breadcrumb"
export function Example() {
return (
<Breadcrumb>
<BreadcrumbList>
<BreadcrumbItem>
<BreadcrumbLink asChild>
<Link href="/">Home</Link>
</BreadcrumbLink>
</BreadcrumbItem>
<BreadcrumbSeparator />
<BreadcrumbItem>
<BreadcrumbPage>Dashboard</BreadcrumbPage>
</BreadcrumbItem>
</BreadcrumbList>
</Breadcrumb>
)
}API reference#
Breadcrumb
The landmark, a <nav aria-label="breadcrumb">. Forwards all native <nav> props. Every part accepts className, merged last.
BreadcrumbList
The wrapping <ol> of crumbs. Forwards all native <ol> props.
BreadcrumbItem
One crumb, an <li>. Forwards all native <li> props.
BreadcrumbLink
An ancestor the user can go to, an <a> with a 40px tall hit area. Forwards all native <a> props.
| Prop | Type | Default | Description |
|---|---|---|---|
| asChild | boolean | false | Merges the crumb styles onto its single child (Radix Slot), such as a Next.js <Link>. |
BreadcrumbPage
The current location, a <span aria-current="page">; the last crumb, not a link. Forwards all native <span> props.
BreadcrumbSeparator
An aria-hidden <li> between crumbs. Draws a caret unless you pass children (/, an icon). Forwards all native <li> props.
BreadcrumbEllipsis
A static "More pages" mark for hidden ancestors, with a 40px hit area. For an openable one, put a DropdownMenu in the item instead. Forwards all native <span> props.