Breadcrumb React component for Tailwind CSS v4
v1.0.0Added in 1.0.0
A React breadcrumb that shows where you are, folds the middle of long paths and gives phones a back link.
Click a crumb to go up a level; the current page is plain text. When the row gets too narrow the middle entries fold into a “…” button, one by one, and come back as soon as there is room; click it (or focus it and press Enter, Space or ArrowDown) for a menu of the hidden pages, walked with the arrow keys and closed with Escape. A crumb with siblings has a small chevron that opens a menu of them with the current one checked. Labels longer than maxItemWidth truncate; hover or focus them (long press on touch) to read the full text. When the trail changes, new crumbs slide in and the others glide into place. Below 640px it becomes one “‹ Parent” back link with a 44px target (or first / … / current), and every menu opens as a bottom action sheet.
Breadcrumb is a Pro React component in the React navigation components category, written in TypeScript for React 19 and Tailwind CSS v4. It installs as source with npx wingo-ui@latest add breadcrumb, together with Button, Dropdown Menu, Tooltip, useOverflowItems, Motion presets and 2 more and the npm packages @radix-ui/react-slot, lucide-react and motion.
Add to a project
Requirements: React 19 and Tailwind CSS v4, in Next.js (App Router or Pages), Vite or React Router. Installation guide · Next.js setup · Vite setup
npx wingo-ui@latest add breadcrumbBreadcrumb is part of Pro, with 298 more Pro items: $8 a month or $150 once. 14-day refund before you download any Pro item. See plans
Usage
Import Breadcrumb from @/components/ui/breadcrumb.
import { Home } from "lucide-react"
import { Breadcrumb, type BreadcrumbEntry } from "@/components/ui/breadcrumb"
import type { NavItem } from "@/lib/navigation"
const clients: NavItem[] = [
{ label: "Northwind Tech Inc.", href: "/clients/42" },
{ label: "Summit Logistics", href: "/clients/57" },
{ label: "Anna Price Consulting", href: "/clients/63" },
]
export function InvoiceTrail() {
const items: BreadcrumbEntry[] = [
{ label: "Home", href: "/", icon: <Home /> },
{ label: "Clients", href: "/clients" },
{ label: "Northwind Tech Inc.", href: "/clients/42", menu: clients },
{ label: "Invoices", href: "/clients/42/invoices" },
{ label: "#2026-0412" },
]
return (
<Breadcrumb
items={items}
labels={{
more: "Show the hidden pages",
back: (label) => `Up to ${label}`,
}}
/>
)
}Props
itemsBreadcrumbEntry[]{ id?: string; label: ReactNode; href?: string; icon?: ReactNode; onSelect?: (event) => void; menu?: NavItem[]; textValue?: string }. Root first; the last entry is the current page. Middle entries without href are plain text (a button with onSelect). menu adds a sibling switcher after the label. An empty label with an icon renders an icon-only crumb named by textValue (read by screen readers, shown in a tooltip). Leave items out to hand-build the trail from the parts.
childrenReactNodeA hand-built trail from the shadcn-compatible parts (BreadcrumbList, BreadcrumbItem, BreadcrumbLink, BreadcrumbPage, BreadcrumbSeparator, BreadcrumbEllipsis), rendered inside the <nav> when items is not set.
separatordefault"chevron""chevron" | "slash" | "dot" | "arrow" | ReactNodeThe glyph between crumbs: ChevronRight, “/”, “·”, ArrowRight or any node. Chevron and arrow flip in right-to-left layouts.
sizedefault"md""sm" | "md"Text 13 / 14px with 4 / 6px gaps. Icons stay 14px.
maxItemWidthdefault200numberpx. Longer labels truncate with an ellipsis and show the full text in a tooltip.
collapsedefault"auto""auto" | "never"auto: while the row does not fit, entries fold into “…” from the second one onward; the first and the current page always stay. never: the trail wraps onto more lines.
maxItemsdefault0numberAlso fold when there are more entries than this, keeping itemsBeforeCollapse at the start and itemsAfterCollapse at the end. 0 folds only when the row does not fit. Ignored when it is smaller than itemsBeforeCollapse + itemsAfterCollapse + 1.
itemsBeforeCollapsedefault1numberEntries kept at the start when folding by maxItems.
itemsAfterCollapsedefault2numberEntries kept at the end when folding by maxItems (the parent and the current page).
mobileVariantdefault"back""back" | "collapse" | "full"What phones get, switched with CSS so the server HTML is right. back: one “‹ Parent” link to the second-to-last entry (falls back to collapse when that entry has no href). collapse: first / … / current. full: the desktop trail.
mobileBreakpointdefault"sm""sm" | "md" | "always"Where the phone form takes over: below 640px (sm), below 768px (md), or at every width (always, for narrow side panels).
animatedefaulttruebooleanWhen the trail changes, new crumbs slide in from the side and the rest glide into place; leaving ones fade. Under reduced motion it only fades.
responsivedefaulttruebooleanThe “…” and sibling menus open as bottom action sheets below 768px. false keeps the dropdown everywhere.
linkComponent(props: LinkComponentProps) => ReactNodeThe router link every crumb renders through (next/link's Link). Default: the LinkProvider's, else a plain <a>.
labels{ navigation?: string; more?: string; back?: (label: string) => string; siblings?: (label: string) => string; cancel?: string }Accessible names and sheet text. Defaults: navigation "Breadcrumb", more "Show hidden pages", back l => "Back to " + l, siblings l => "Switch " + l, cancel "Cancel".
classNamesPartial<Record<"list" | "item" | "link" | "page" | "separator" | "ellipsis" | "back", string>>Extra classes for the inner parts; className styles the <nav>.
Parts
BreadcrumbList
componentThe <ol> that lays out a hand-built trail in one row. Takes every <ol> prop.
BreadcrumbItem
componentOne crumb's <li>; put a BreadcrumbLink or a BreadcrumbPage inside.
BreadcrumbLink
componentA crumb link rendered through NavLink. asChild styles your own element (a router Link); without href it renders a button.
hrefstringWhere the crumb goes. Leave it out for a button.
asChilddefaultfalsebooleanRenders your single child with the crumb's look.
linkComponentLinkComponentA router link component, like next/link, used for the anchor.
BreadcrumbPage
componentThe current page: plain text with aria-current="page", truncated with the same max width as the links.
BreadcrumbSeparator
componentAn aria-hidden <li role="presentation"> with the glyph between crumbs. Pass children for a custom glyph.
kind"chevron" | "slash" | "dot" | "arrow"The glyph; defaults to the Breadcrumb's separator.
BreadcrumbEllipsis
componentThe “…” button for folded crumbs. With items it opens a menu of those pages (a bottom sheet on phones); without items it is the bare glyph.
itemsBreadcrumbEntry[]The hidden pages listed in the menu.
openbooleanControlled menu state.
onOpenChange(open: boolean) => voidCalled when the menu opens or closes.
responsivebooleanA bottom action sheet below 768px instead of a dropdown. Defaults to the Breadcrumb's responsive.
BreadcrumbEntry
typeOne entry of items: { id?, label, href?, icon?, onSelect?, menu?, textValue? }.
BreadcrumbProps
typeThe props of Breadcrumb, for wrappers that build the trail from your router.
Examples
Separators
chevron, slash, dot and arrow; chevron and arrow flip in right-to-left layouts.
maxItems on a file path
maxItems={4} keeps the first folder and the last two entries; the rest waits in the “…” menu. In a narrow column the width fold hides more.
Sibling switchers
A chevron after a crumb opens its siblings, the current one checked.
Phone forms
Below 640px: one “‹ Parent” link (back) or first / … / current (collapse). Shown here at every width.
Long labels
Labels past maxItemWidth truncate and show the full text in a tooltip.
Sizes
sm (13px) and md (14px), with an icon-only Home crumb or an icon and a label.
Built from parts
shadcn-compatible parts for hand-built trails: List, Item, Link, Page, Separator, Ellipsis.
Dependencies
Files
- components/ui/breadcrumb.tsx
FAQ
Is the React Breadcrumb component free?
The preview, props and docs are free; copying the source needs a Pro plan. See plans.
How do I install Breadcrumb?
Run npx wingo-ui@latest add breadcrumb. It also adds the Wingo UI items it builds on (Button, Dropdown Menu, Tooltip, useOverflowItems, Motion presets and 2 more) and the npm packages @radix-ui/react-slot, lucide-react and motion. With shadcn, add the @wingo-ui registry with your API key, then run npx shadcn@latest add @wingo-ui/breadcrumb.
How does Breadcrumb behave on phones?
The “…” and sibling menus open as bottom action sheets below 768px. false keeps the dropdown everywhere. The responsive prop controls this and is on by default.
See also
Used in
More React navigation components
Articles using this component
- Nextjs JSON LD: Typed Schema That Matches the Page
Next.js and Tailwind CSS10 min read