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).
Import
Section titled “Import”<script> import Breadcrumb from "@invisible-ui/svelte/Breadcrumb.svelte";</script><script setup> import { Breadcrumb } from "@invisible-ui/vue";</script>import { Breadcrumb } from "@invisible-ui/react";<script type="module"> import "@invisible-ui/elements/define";</script>
<ds-breadcrumb></ds-breadcrumb>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>| Prop | Type | Default | Description |
|---|---|---|---|
items * | BreadcrumbItem[] | — | The trail, from the root to the current page (rendered last). |
label | string | undefined | undefined | Accessible name for the landmark. |
separator | string | "/" | Separator between items. Defaults to "/". |
| Prop | Type | Default | Description |
|---|---|---|---|
items * | BreadcrumbItem[] | — | |
label | string | undefined | Accessible name for the landmark. Defaults to the catalog's "Breadcrumb". |
separator | string | "/" | Separator between items. Defaults to "/". |
| Prop | Type | Default | Description |
|---|---|---|---|
items * | BreadcrumbItem[] | — | The trail, from the root to the current page (rendered last). |
label | string | — | Accessible name for the landmark. Defaults to the catalog's "Breadcrumb". |
separator | string | "/" | Separator between items. |
| Attribute | Reactive | Description |
|---|---|---|
label | yes | the landmark name; "Breadcrumb" by default |
separator | yes | the text between items; "/" by default |
Reactive attributes re-render the element when they change after the first render.
Properties: items (the trail, from the root to the current page).
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.
Example
Section titled “Example”<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-*.