Breadcrumbs
Breadcrumbs that collapse middle levels into a … menu when space runs out, keeping the first and last two visible.
$
View as Markdownnpx shadcn@latest add https://sundaeui.dev/r/breadcrumbs.jsonOverview
The trail measures itself: when it would overflow, middle crumbs fold into an ellipsis button that opens a small menu of the hidden levels.
The current page is plain text with aria-current. Long single labels truncate with an ellipsis rather than wrapping.
When to use
- Deep hierarchies: file systems, docs, admin, e-commerce categories.
When not to use
- Flat sites with one or two levels.
Installation
$
pnpm dlx shadcn@latest add https://sundaeui.dev/r/breadcrumbs.json$
npx shadcn@latest add https://sundaeui.dev/r/breadcrumbs.json$
yarn dlx shadcn@latest add https://sundaeui.dev/r/breadcrumbs.json$
bunx --bun shadcn@latest add https://sundaeui.dev/r/breadcrumbs.jsonWorks in any React project. Files are written to components/sundae/. Read the source in the stage’s Code view.
- No dependencies beyond React 18 or later.
- Copy breadcrumbs.tsx and breadcrumbs.css into components/sundae/.
- The CSS file is imported by the component, so no extra configuration is needed.
- Import the component and use it as shown below.
Usage
import { Breadcrumbs } from '@/components/sundae/breadcrumbs'
<Breadcrumbs />Props
| Prop | Type | Default |
|---|---|---|
items*Path from root to current. | { label: string; href: string }[] | — |
maxVisibleCrumbs before collapsing. | number | 4 |
fillSurface: dark or light. | 'dark' | 'light' | 'dark' |
Accessibility
- A nav landmark labelled "Breadcrumb" with an ordered list.
- The ellipsis is a menu button labelled "Show 3 more levels".
- Reduced motion removes the movement and keeps every state change.
Customization
- Colours are CSS custom properties on .sd-brc; override them in your own stylesheet.
- fill="light" switches the built-in light palette.
FAQ
- Is Breadcrumbs free?
- Yes. Breadcrumbs is free for personal and commercial projects, with full source on this page.
- How do I install Breadcrumbs?
- Run npx shadcn@latest add https://sundaeui.dev/r/breadcrumbs.json. The files are written to components/sundae/. It has no dependencies beyond React 18 or later.
- Does Breadcrumbs support keyboard and screen readers?
- A nav landmark labelled "Breadcrumb" with an ordered list. The ellipsis is a menu button labelled "Show 3 more levels".
- Does Breadcrumbs respect reduced motion?
- Reduced motion removes the movement and keeps every state change.
More like this
All navigation →Pagination
Navigation · RefinedUnderline Tabs
Navigation · Refined- Pro
File Tree
Navigation · Refined - Pro
Collapsible Sidebar
Navigation · Refined Vertical Tabs
Navigation · Refined- Pro
Nav Dropdown
Navigation · Refined