Navigation

Breadcrumb

Shows the current page’s place in a hierarchy, as a trail of links back to the top.

Copy
<script setup lang="ts">
const items = [
  { label: 'Projects', href: '#' },
  { label: 'juxt-ui', href: '#' },
  { label: 'Settings' },
]
</script>

<template>
  <JBreadcrumb :items="items" />
</template>

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.

Copy
<script setup lang="ts">
const items = [
  { label: 'Home', href: '#' },
  { label: 'Projects', href: '#' },
  { label: 'juxt-ui', href: '#' },
  { label: 'Components', href: '#' },
  { label: 'Breadcrumb' },
]
</script>

<template>
  <JBreadcrumb :items="items" :max-items="4" />
</template>

Custom crumbs#

Built by hand with the default slot — here the first crumb carries an icon.

API #

Props

PropTypeDefault Description
itemsBreadcrumbItem[]—Trail of items, first to last. { label, href? }. The last item renders as the current page.
labelstring'Breadcrumb'Accessible name for the nav landmark.
maxItemsnumber—Collapse middle items behind an ellipsis once the trail is longer than this.

Slots

SlotProps 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 uses aria-current="page" and is not a link.
  • Separators between crumbs are decorative (::before), not characters, so they aren’t announced.