Breadcrumbs
ProNewA trail that stays on one line: the middle of a long path folds into a menu and long labels truncate.
Installation
pnpm dlx shadcn@latest add @viewport/breadcrumbs
First time? Add the @viewport registry to components.json. Setup takes one minute.
Usage
The code behind the preview above comes with Truffle Pro.
Props
| Prop | Type | Default |
|---|---|---|
| items* | Crumb[]The path, from the root to the current page. The last item is the current page and is not a link. | — |
| maxItems | numberThe most items shown before the middle of the path folds into a menu. | 4 |
| renderLink | (props: { href: string; className: string; children: React.ReactNode }) => React.ReactNodeRender links with your router's component, e.g. `(props) => <Link {...props} />`. | — |
Accessibility
- A nav landmark with an ordered list; the last item has aria-current=page.
- The folded levels are in a named menu.
- Separators are hidden from screen readers and flip in right-to-left layouts.