Breadcrumb
Show where a page sits in a hierarchy.
npx shadcn@latest add @silicon-ui/breadcrumbInstallation
With the shadcn CLI
npx shadcn@latest add @silicon-ui/breadcrumbManually
Install the dependencies
npm install @radix-ui/react-dropdown-menu lucide-react motionCopy these files into your project
- components/silicon-ui/breadcrumb/breadcrumb.tsx
- components/silicon-ui/breadcrumb/breadcrumb.module.css
Shared with other components. Skip any you already have.
- components/silicon-ui/lib/silicon-provider.tsx
- components/silicon-ui/dropdown-menu/dropdown-menu.tsx
- components/silicon-ui/dropdown-menu/dropdown-menu.module.css
- components/silicon-ui/lib/menu-highlight.tsx
- components/silicon-ui/lib/fluid-hover.tsx
Add the foundation, once per app, for the design and motion tokens
npx shadcn@latest add @silicon-ui/silicon-foundation
Usage
API reference
| Prop | Type | Default |
|---|---|---|
items*The path from the top level to the current page, which is the last item (unless `includesCurrent` is false). | BreadcrumbItem[] | — |
includesCurrentExperimental. Whether the last item is the current page (default true). False makes every item a link back up and marks none as current: for a page bar whose title already names the page, `items` can be the parent alone. | boolean | true |
ariaLabelThe navigation landmark's name (default "Breadcrumb"). | string | "Breadcrumb" |
maxItemsExperimental. The most crumbs to show, at least 2. A longer path shows the first crumb, a "…" menu of the levels between, and the last `maxItems - 1` crumbs. By default the path never collapses. | number | — |