Navigation
Breadcrumb
Shows the current page’s place in a hierarchy, as a trail of links back to the top.
Installation #
With the Nuxt module, every component is auto-imported — there is nothing to add. In a plain Vue project, import what you use:
Copy
import { JBreadcrumb } from '@juxtui/ui'Usage #
Copy
<JBreadcrumb :items="[
{ label: 'Projects', href: '/projects' },
{ label: 'juxt-ui', href: '/projects/juxt-ui' },
{ label: 'Settings' },
]" />Omit href on the last item — it renders as the current page instead of a link.
Without items, pass your own <li class="j-breadcrumb__item"> elements into the default slot for full control over each crumb.
Variants & examples #
Collapsed#
Past max-items, the middle of the trail collapses to an ellipsis, keeping the first crumb and a tail of the most recent ones.
Custom crumbs#
Built by hand with the default slot — here the first crumb carries an icon.
API #
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| items | BreadcrumbItem[] | — | Trail of items, first to last. { label, href? }. The last item renders as the current page. |
| label | string | 'Breadcrumb' | Accessible name for the nav landmark. |
| maxItems | number | — | Collapse middle items behind an ellipsis once the trail is longer than this. |
Slots
| Slot | Props | Description |
|---|---|---|
| default | — | Your own <li class="j-breadcrumb__item"> crumbs, used when items is omitted. |
Accessibility #
- Wrapped in a
<nav>landmark labelled “Breadcrumb” by default. - Items are a real
<ol>/<li>list; the current page usesaria-current="page"and is not a link. - Separators between crumbs are decorative (
::before), not characters, so they aren’t announced.