Breadcrumb
The path to the current page, from the top of the site down. Each step is a link; the last one is the page you are on and is not a link. Use it under a page title or in a toolbar, not as navigation on its own.
Install
npx shadcn@latest add @nelumbo/breadcrumbBasic
The current page is a BreadcrumbPage with aria-current="page", set in a tonal chip. Links are muted pills that fill with the state layer on hover and squeeze when pressed.
Slash separator
separator="slash" on Breadcrumb swaps every chevron for a slash. Pass your own children to a BreadcrumbSeparator for anything else.
Contained
variant="contained" sets the trail on a tonal track and raises the current page on it, like the selected segment of a segmented button. Icons in links and in the page sit at 18px; the page's icon fills.
Collapsed
When the trail is long, fold the middle steps into an ellipsis. The ellipsis is a DropdownMenu trigger, so the hidden steps open in a menu. The trigger is announced as More.
Custom separator
Pass children to BreadcrumbSeparator to replace the chevron. Separators stay hidden from assistive tech either way.
Long trail, on a phone
At 390px the trail wraps onto a second line rather than scrolling sideways. A long page name is capped and cut with an ellipsis, and its full text stays in the DOM for screen readers.
Your own link
asChild gives the link styles to your element, such as a router Link. The state layer and focus ring come with it.
Usage
import { Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator,} from "@/components/ui/breadcrumb"<Breadcrumb> <BreadcrumbList> <BreadcrumbItem> <BreadcrumbLink asChild><Link href="/">Home</Link></BreadcrumbLink> </BreadcrumbItem> <BreadcrumbSeparator /> <BreadcrumbItem> <BreadcrumbPage>Settings</BreadcrumbPage> </BreadcrumbItem> </BreadcrumbList></Breadcrumb>Props
| Prop | Type | Default | Notes |
|---|---|---|---|
Breadcrumb | nav props | Labelled "breadcrumb" by default | |
Breadcrumb variant | "plain" | "contained" | "plain" | contained sets the trail on a tonal track with the page raised on it |
BreadcrumbList | ol props | Wraps onto more lines on narrow screens | |
BreadcrumbItem | li props | ||
BreadcrumbLink | a props, asChild | false | Muted link; asChild styles your own element |
BreadcrumbPage | span props | The current page: aria-current="page" | |
BreadcrumbSeparator | children | chevron_right | Replaces the default chevron; hidden from assistive tech |
BreadcrumbEllipsis | span props | Collapsed steps; announced as More |