Skip to content

Breadcrumb

A navigation trail from the site root to the current page. Linked ancestors are underlined; the last item is the current page (aria-current="page", in the selection color).

<script>
import Breadcrumb from "@invisible-ui/svelte/Breadcrumb.svelte";
</script>

In Elements, assign the trail as a property:

<ds-breadcrumb></ds-breadcrumb>
<script type="module">
document.querySelector("ds-breadcrumb").items = [
{ label: "Home", href: "/", home: true },
{ label: "Components", href: "/components" },
{ label: "Breadcrumb" },
];
</script>
PropTypeDefaultDescription
items *BreadcrumbItem[]—The trail, from the root to the current page (rendered last).
labelstring | undefinedundefinedAccessible name for the landmark.
separatorstring"/"Separator between items. Defaults to "/".

Every href is rendered as given: pass only URLs you trust or have sanitized. See Security.

The separator is text. The browser mirrors the paired characters such as ›, > and « in right-to-left text; an arrow such as → is not mirrored, so pick a separator that reads both ways, like the default /.

Items are data-driven; mark the first with home: true for a leading home glyph, and omit href on the current page.

<Breadcrumb
items={[
{ label: "Home", href: "/", home: true },
{ label: "Components", href: "/components" },
{ label: "Breadcrumb" },
]}
/>

In React, the landmark name comes from the provider’s catalog (breadcrumb.label) unless label is given:

<Breadcrumb
separator="›"
items={[
{ label: "Home", href: "/", home: true },
{ label: "Components", href: "/components" },
{ label: "Breadcrumb" },
]}
/>

Themeable via --ds-breadcrumb-*.