Breadcrumb
A hierarchy trail showing where a page sits, with linked ancestors and a marked current location.
Live demo
Breadcrumb renders a location trail: an ordered list of ancestor links ending in the current page, with a separator glyph between each step. It is a <nav> landmark labeled "Breadcrumb" wrapping an <ol>; ancestors render as anchors and the final crumb renders as plain text carrying aria-current="page".
Pass the trail declaratively via the items array (each entry is { label, href?, current? }) and the engine builds the list, injects the separators, and marks the last item current. The separator glyph defaults to / and is purely decorative. A tone tints the ancestor links and three sizes scale the type. For fully custom crumbs, omit items and provide your own <li> markup in the default slot.
When to use
How this component composes with the rest of the set.
Props
5 props, straight from the manifest.
| Prop | Type | Default | Bindings | Description |
|---|---|---|---|---|
Appearance
Variants
accent
Ancestor links tinted with the accent tone (the default).
neutral
Ancestor links in neutral ink for a quieter trail.
Sizes
sm
Compact.
md
Default.
lg
Large.
States
hover
Pointer over an ancestor link; it underlines.
focus-visible
Keyboard focus on a link: a token-colored ring, plus a transparent outline promoted to a real one in forced-colors mode.
Anatomy
The named parts that make up the component, with their selectors.
breadcrumb
The <nav> landmark wrapping the trail, carrying the tone and size classes.
list
The ordered list laying the crumbs and separators out in a wrapping row.
item
An ancestor link (anchor) or the current crumb (text). Links tint with the tone; the current crumb is bold neutral ink.
separator
The decorative glyph between crumbs, hidden from assistive tech.
Tokens & coverage
What the component consumes, checked live against what the algorithm produces.
Live coverage check against the xoji-default register
(derive(xojiDefault, { anchors }) →
coverComponent(manifest, register)). Every token this component
consumes must be a key the algorithm produces.
--accent-2-vivid
--accent-3-vivid
--accent-4-vivid
--accent-vivid
--black-vivid
--blue-vivid
--border-normal
--border-thick
--brown-vivid
--cyan-vivid
--danger-vivid
--duration-fast
--ease-standard
--fg-0
--fg-2
--fg-3
--font-sans
--gray-vivid
--green-vivid
--info-vivid
--leading-normal
--neutral-vivid
--orange-vivid
--pink-vivid
--purple-vivid
--radius-sm
--red-vivid
--ring
--space-0
--space-1
--success-vivid
--text-body
--text-sm
--text-xs
--warn-vivid
--weight-medium
--white-vivid
--yellow-vivid
Slots
Custom crumb markup (<li> items and separators) used when items is omitted.
Accessibility
Code
A location trail
An ordered trail of linked ancestors ending in the current page; tone and separator are adjustable.
<xoji-breadcrumb
items='[
{"label":"Home","href":"/"},
{"label":"Library","href":"/library"},
{"label":"Themes"}
]'
></xoji-breadcrumb>
<xoji-breadcrumb tone="neutral" separator="›" items='[
{"label":"Docs","href":"/docs"},
{"label":"Components","href":"/docs/components"},
{"label":"Breadcrumb"}
]'></xoji-breadcrumb>
<xoji-breadcrumb label="You are here">
<li class="xoji-breadcrumb__item"><a class="xoji-breadcrumb__link" href="/">Home</a></li>
<li class="xoji-breadcrumb__separator" aria-hidden="true">/</li>
<li class="xoji-breadcrumb__item"><span class="xoji-breadcrumb__current" aria-current="page">Settings</span></li>
</xoji-breadcrumb>
<script lang="ts">
import { Breadcrumb } from "@xoji/svelte";
const trail = [
{ label: "Home", href: "/" },
{ label: "Library", href: "/library" },
{ label: "Themes" },
];
</script>
<Breadcrumb items={trail} />
<Breadcrumb tone="neutral" separator="›" items={trail} />
---
import { Breadcrumb } from "@xoji/astro";
const trail = [
{ label: "Home", href: "/" },
{ label: "Library", href: "/library" },
{ label: "Themes" },
];
---
<Breadcrumb items={trail} />
<Breadcrumb tone="neutral" separator="›" items={trail} />