component :: Breadcrumbs

The .breadcrumbs component is a nav > ol trail with CSS-only separators, and optional BreadcrumbList JSON-LD for search engines.

FileDescriptionSource
component.breadcrumbs.cssAll breadcrumb stylesGithub
Breadcrumbs.astroThe Astro componentGithub
--breadcrumbs-* block in default themeTheme tokens (see table below)Github

HTML

<nav class="breadcrumbs" aria-label="Breadcrumbs">
<ol>
<li><a href="/">Home</a></li>
<li><a href="/components/start">Components</a></li>
<li><span aria-current="page">Breadcrumbs</span></li>
</ol>
</nav>

The last crumb is text, not a link, marked with aria-current="page"; the separators are generated content with empty alt text, so screen readers read the trail as a clean list. The separator lives in CSS, not the markup β€” change it by overriding one token:

:root {
--breadcrumbs-separator: "β†’";
}

Custom properties

PropertyDescription
--breadcrumbs-separatorSeparator string (default /).
--breadcrumbs-separator-colorSeparator color.
--breadcrumbs-colorLink color.
--breadcrumbs-color-currentCurrent page (last crumb) color.

Astro component

PropTypeDefaultDescription
items{ label, href? }[]β€”The trail. The last item (or any item without href) is text.
ariaLabelstring"Breadcrumbs"The nav’s accessible name.
jsonLdbooleanfalseEmit BreadcrumbList structured data (hrefs resolved to absolute).
classstringundefinedAdditional CSS classes.

Examples