cv-breadcrumb
Navigation landmark that displays a trail of links showing the user's current location within a hierarchical structure.
Headless: createBreadcrumb
Usage
Anatomy
<cv-breadcrumb> (host)
└── <nav part="base" role="navigation" aria-label="Breadcrumb">
└── <ol part="list">
└── <slot> ← cv-breadcrumb-item elementsAttributes
| Attribute | Type | Default | Description |
|---|---|---|---|
value | String | "" | Value of the current (active) breadcrumb item. Reflects and controls which item has aria-current="page". |
aria-label | String | "Breadcrumb" | Accessible label for the navigation landmark |
aria-labelledby | String | "" | ID of an element that labels the navigation landmark. When set, aria-label is omitted. |
Slots
| Slot | Description |
|---|---|
(default) | cv-breadcrumb-item elements |
CSS Parts
| Part | Element | Description |
|---|---|---|
base | <nav> | Navigation landmark wrapper |
list | <ol> | Ordered list container for breadcrumb items |
CSS Custom Properties
| Property | Default | Description |
|---|---|---|
--cv-breadcrumb-gap | var(--cv-space-2, 8px) | Gap between breadcrumb items |
--cv-breadcrumb-row-gap | var(--cv-space-1, 4px) | Row gap when breadcrumb items wrap |
Events
No component-specific events. Navigation uses standard link click behavior.
Child Elements
cv-breadcrumb-item
Anatomy
<cv-breadcrumb-item> (host)
├── <span part="prefix">
│ └── <slot name="prefix">
├── <a part="link" role="link" href="…" aria-current="page"?>
│ └── <slot> ← label text
├── <span part="suffix">
│ └── <slot name="suffix">
└── <span part="separator" aria-hidden="true">
└── <slot name="separator">/</slot>Attributes
| Attribute | Type | Default | Description |
|---|---|---|---|
value | String | "" | Unique identifier for this item. Auto-generated as item-{n} if empty. |
href | String | "" | URL destination. Defaults to # if empty. |
current | Boolean | false | Whether this item represents the current page. Managed by parent, reflects aria-current="page" on the link. |
show-separator | Boolean | true | Whether the separator is visible. Managed by parent — hidden on the last item. |
Internal property (not reflected):
| Property | Type | Default | Description |
|---|---|---|---|
linkId | String | "" | DOM id for the link element, set by parent from headless contract |
Slots
| Slot | Description |
|---|---|
(default) | Label text |
prefix | Icon or element before the label |
suffix | Icon or element after the label |
separator | Separator between items. Default: / |
CSS Parts
| Part | Element | Description |
|---|---|---|
link | <a> | The anchor element |
prefix | <span> | Prefix container |
suffix | <span> | Suffix container |
separator | <span> | Separator container (has aria-hidden="true") |
CSS Custom Properties
| Property | Default | Description |
|---|---|---|
--cv-breadcrumb-item-gap | var(--cv-space-2, 8px) | Gap between prefix, link, suffix, and separator |
--cv-breadcrumb-item-font-size | var(--cv-font-size-sm, .875rem) | Item label font size |
--cv-breadcrumb-item-link-max-inline-size | 18rem | Maximum width before label truncation |
--cv-breadcrumb-item-link-min-block-size | 28px | Minimum link target height |
--cv-breadcrumb-item-link-padding-block | 4px | Link block-axis padding |
--cv-breadcrumb-item-link-padding-inline | 7px | Link inline-axis padding |
--cv-breadcrumb-item-link-radius | var(--cv-radius-1, 6px) | Link border radius |
--cv-breadcrumb-item-color | var(--cv-color-text-muted) | Default item text color |
--cv-breadcrumb-item-hover-background | var(--cv-color-surface-hover) | Hover background for non-current items |
--cv-breadcrumb-item-hover-color | var(--cv-color-text) | Hover text color for non-current items |
--cv-breadcrumb-item-focus-ring | var(--cv-color-focus-ring) | Focus-visible outline color |
--cv-breadcrumb-item-separator-opacity | 0.62 | Opacity of the separator |
--cv-breadcrumb-item-current-background | var(--cv-color-primary-surface) | Current item background |
--cv-breadcrumb-item-current-border-color | var(--cv-color-primary-border) | Current item border color |
--cv-breadcrumb-item-current-color | var(--cv-color-text-strong) | Current item text color |
--cv-breadcrumb-item-current-font-weight | var(--cv-font-weight-semibold, 600) | Font weight of the current item's link |
Visual States
| Host selector | Description |
|---|---|
:host([current]) | Current page — link has highlighted surface styles and aria-current="page" |
:host(:not([show-separator])) | Separator hidden (last item) |
[part="link"]:focus-visible | Keyboard focus ring on the interactive link |