Breadcrumb
Navigation trail of link buttons with separators, a current page and optional collapsing.
Attributes
| Name | Type | Default | Description |
|---|---|---|---|
max-items | number | 0 | Upper bound on visible items (the first, then the last ones behind an ellipsis). 0 lets the width decide alone. |
aria-label | string | — | Accessible name of the navigation landmark. |
Slots
| Name | Description |
|---|---|
(default) | The items, in order. Use c2-link-button for links; any element works for the current page. |
separator | Custom separator, cloned between every pair of items (text such as /, or an icon). |
CSS parts
Shadow DOM styling hooks used with ::part(name). Prefer CSS custom properties when they cover the change.
| Name | Description |
|---|---|
separator | Component-owned region containing the separator slot or its fallback between breadcrumb items. |
item | A list item containing one breadcrumb and its following separator. |
ellipsis | The control that reveals breadcrumb items hidden by overflow or max-items. |
list | The ordered list containing the complete breadcrumb trail. |
CSS custom properties
Grouped by semantic target and state from --c2-<component>__<target>__<state>--<property>. Click a group to collapse it; click a name to copy it.
| Name | Type | Default | Description |
|---|---|---|---|
--c2-breadcrumb--gap | pixel | 4px | Space between an item and its separator. |
--c2-breadcrumb__separator--size | pixel | 14px | Icon size and font size of the separator. |
--c2-breadcrumb__separator--color | color | #a1a1aa | |
--c2-breadcrumb__item--color | color | #71717a | |
--c2-breadcrumb__item--font-size | font-size | 14px | |
--c2-breadcrumb__item--font-weight | font-weight | 500 | |
--c2-breadcrumb__item--padding-top | padding | 2px | |
--c2-breadcrumb__item--padding-right | padding | 4px | |
--c2-breadcrumb__item--padding-bottom | padding | 2px | |
--c2-breadcrumb__item--padding-left | padding | 4px | |
--c2-breadcrumb__item--border-radius | border-radius | 4px | |
--c2-breadcrumb__item--background-color | color | — | |
--c2-breadcrumb__item__hover--color | color | #18181b | |
--c2-breadcrumb__item__hover--background-color | color | — | |
--c2-breadcrumb__item__hover--text-decoration | text-decoration | none | |
--c2-breadcrumb__item__current--color | color | #18181b | |
--c2-breadcrumb__item__current--font-weight | font-weight | 500 | |
--c2-breadcrumb__item__current--background-color | color | — | |