Skip to content

BbBreadcrumbs

The trail that says where the reader is and how to get back up.

import { BbBreadcrumbs } from 'bitboss-ui';

On this page

Use it for

Put BbBreadcrumbs at the top of a detail view, above the title. It answers two questions at once: where am I, and how do I get back up.

Use something else when

  • BbTabs, if they are peer views of the same record: Overview, Activity, Settings
  • BbPagination, if the reader is stepping through a paged result set

Pass Through

Hover or tap a part to outline it. Toggles flip loading, errors and warnings when the component has them — only parts highlight.

Show one breadcrumb landmark per view.

The trail

Each item is { key, text } plus a navigation target. key must be unique: it is also the name of that crumb's own slot.

Leave the last item without a target. That is what makes it the current page: it gets aria-current="page" and the theme renders it non-interactive. An href there gives you a link nobody can click.

Coming from v2key must be a string

A numeric key that ran in v2 now fails type checking. The fix is String(id). The runtime already stringified it, so nothing else changes.

Give every crumb its own target: href, to, or an onClick.

  • AppShell.vue

When the hierarchy lives in client state rather than in routes, give the ancestors an onClick. The crumbs are still real buttons, and crumbs folded into the overflow menu keep their handler. Never wrap the trail in your own click-to-route handler.

disabled works at two levels. On one item, that crumb loses its href and gains aria-disabled. On the component, every crumb and the overflow button freeze together. Use it for a level the reader can no longer open, rather than shipping a dead link.

Long trails fold themselves

You do not manage overflow.

Drag the frame narrower. The current page and its nearest ancestors stay put; the hidden levels keep their targets inside the menu.

When the trail outgrows its container the earliest crumbs fold into an ellipsis menu, root first. The current page and its nearest ancestors stay visible, and the hidden crumbs keep their targets.

Pass the full items array. Pre-slicing removes the keyboard-ready overflow menu.

The fold point is estimated from label text. Start with offset-width for icons, slots, and edge regions. Use estimation-bias, divider-width, gap-width, or ellipsis-width only when their matching visual changes.

In a flex row, use class="min-w-0 flex-auto" and keep siblings shrink-0. The full trail renders on the server, then folds after hydration.

Icons and edge regions

A fixed icon per crumb is an item field, not a slot: prepend:icon and append:icon.

For varying content, use item:prepend or item:append. These slots are inside the crumb link, so do not add interactive descendants. Account for custom content with offset-width.

One crumb, its own slot

Every item also gets slots named after its key: #<key> replaces that crumb's text, #<key>:prepend and #<key>:append what sits before and after it.

Use these slots when one level needs richer content. A crumb in the overflow menu follows the dropdown's rules.

The name is normalized: every run of spaces, hyphens and punctuation becomes _, and the result is lowercased. An item keyed Order History is served by #order_history, and one keyed order-history by the same slot.

Coming from v2slot names are normalized

A raw v2-era name matches nothing and silently renders the default label. That is the failure mode to look for after an upgrade.

Avoid slot-reserved keys such as prepend, append, divider, ellipsis, activator, and item.

Divider and overflow button

The separator between crumbs is a slot, and only a slot.

Dividers are decorative and stay aria-hidden, so never encode meaning in one. If yours is visually wider than the default, declare it with divider-width.

The ellipsis slot receives overflowCount and keeps the accessible button and menu behavior. Pair a wider replacement with ellipsis-width.

Coming from v2divider removed

There is no divider prop in v3, and passing it now just leaks an attribute onto the markup. The default separator is a small chevron, not a /. The default of divider-width moved from 5 to 16, which matters only if you had tuned the old value.