-
Notifications
You must be signed in to change notification settings - Fork 10
Breadcrumbs [Draft]
- Breadcrumb component specification
Team name: TBD
Developer name: TBD
Designer name: TBD
TBD
TBD
| # | Author | Date | Description |
|---|---|---|---|
| 1 | Radoslav Karaivanov | 2026-08-04 | Initial draft |
The igc-breadcrumbs component is a navigation container that renders an ordered
trail of igc-breadcrumb items, separated by a configurable icon. It communicates
a user's location within a site's hierarchy and provides a way back to
higher-level pages.
The pair of elements is suitable for a variety of navigation scenarios such as:
- File browsers: current folder path from the root down to the active folder
- E-commerce: category > subcategory > product navigation trail
- Multi-step wizards or nested content: showing the current section within a larger structure
- Admin dashboards: current location within a nested menu structure
- Two composable elements: a
igc-breadcrumbscontainer that manages shared state and aigc-breadcrumbitem that renders arbitrary slotted content (typically a link) - Default separator icon configurable on the container and automatically propagated to every item via context
- Per-item separator override through a dedicated slot
- Current page marking through a boolean property that reflects
aria-current="page" - Prefix and suffix slots on each item for supplementary content (icons, badges, etc.)
- Automatic hiding of the trailing separator on the last item
- Accessibility-first: renders the ARIA list/listitem pattern and mirrors the separator icon in RTL layouts
- Themeable through CSS custom properties and shadow parts
- The container must render its slotted
igc-breadcrumbchildren with the ARIAlistrole, and each item must expose thelistitemrole. - The container must expose a
separatorproperty/attribute that sets the default separator icon used by all descendant items. - An individual item must be able to override the separator through a
separatorslot. - The separator must not be rendered after the last item in the trail.
- An item must be able to mark itself as the current page through a
currentproperty/attribute, reflectingaria-current="page"on the host. - An item must support
prefixandsuffixslots for supplementary content around its main content. - The elements must be integrated and themeable with the theming mechanism of the library.
- The elements must be WAI-ARIA compliant, following the breadcrumb navigation pattern.
- The separator icon must be mirrored automatically in RTL layouts without additional configuration.
As an end-user, I expect to be able to:
- see a trail of links representing the path from a top-level page down to the page I am currently viewing.
- see a visual separator between each item in the trail.
- identify which item in the trail represents the page I am currently on.
- navigate back to any of the higher-level pages by activating its link.
As a developer, I expect to be able to:
- slot arbitrary content, typically a link, inside each breadcrumb item.
- control the default separator icon used across all items in a trail.
- override the separator icon or content for an individual item.
- mark an item as the current page and be able to read that state back.
- slot prefix and/or suffix content, such as icons, around an item's main content.
- wrap the trail in a
<nav>landmark with an application-provided accessible label.
The breadcrumb trail presents a clear, horizontal (wrapping) row of items:
- Each item renders its slotted content, typically a link, followed by a separator icon.
- The item representing the current page is visually distinguished (non-interactive,
different color) via the
currentstate, and — being the last item in the trail — is not followed by a separator. - In Right-to-Left layouts, the separator icon is mirrored automatically.
- Screen readers announce the trail as a list, its items, and the current page
through
aria-current="page".
The igc-breadcrumbs and igc-breadcrumb elements are designed for ease of
integration with a declarative API — the container manages the shared separator
state, while items are free to render arbitrary slotted content.
<nav aria-label="Breadcrumb">
<igc-breadcrumbs>
<igc-breadcrumb>
<a href="/home">Home</a>
</igc-breadcrumb>
<igc-breadcrumb>
<a href="/home/category">Category</a>
</igc-breadcrumb>
<igc-breadcrumb current>
<a href="/home/category/item">Item</a>
</igc-breadcrumb>
</igc-breadcrumbs>
</nav><igc-breadcrumbs separator="chevron_right">
<igc-breadcrumb><a href="/home">Home</a></igc-breadcrumb>
<igc-breadcrumb current><a href="/home/item">Item</a></igc-breadcrumb>
</igc-breadcrumbs><igc-breadcrumb>
<a href="/home">Home</a>
<span slot="separator">/</span>
</igc-breadcrumb><igc-breadcrumb>
<span slot="prefix">🏠</span>
<a href="/home">Home</a>
</igc-breadcrumb>const items = document.querySelectorAll('igc-breadcrumb');
// Move the "current" marker to the last item after a client-side navigation
for (const item of items) {
item.current = false;
}
items[items.length - 1].current = true;The breadcrumb elements do not contain any built-in text content that requires
localization. The nav landmark's aria-label and the slotted link text are
provided by the consuming application.
The elements do not implement custom keyboard handling. Navigation relies on the native behavior of the slotted interactive content:
| Key | Description |
|---|---|
| Tab / Shift + Tab | Moves focus between the interactive elements (typically links) slotted into each breadcrumb item. |
| Enter / Space | Activates the currently focused link, following the native behavior of the slotted element. |
igc-breadcrumbs:
| Name | Attribute | Reflects | Type | Default | Description |
|---|---|---|---|---|---|
| separator | separator | Yes | string | 'tree_expand' | The icon name used as the default separator between breadcrumb items. |
igc-breadcrumb:
| Name | Attribute | Reflects | Type | Default | Description |
|---|---|---|---|---|---|
| current | current | Yes | boolean | false | Marks this breadcrumb as representing the current page. |
None.
None.
igc-breadcrumbs:
| Name | Description |
|---|---|
| (default) | Default slot for the breadcrumb items. |
igc-breadcrumb:
| Name | Description |
|---|---|
| (default) | The main content of the breadcrumb, typically an anchor (<a>) element. |
| prefix | Renders content before the main breadcrumb content. |
| suffix | Renders content after the main breadcrumb content. |
| separator | Overrides the default separator icon rendered after the breadcrumb item. |
igc-breadcrumb:
| Name | Description |
|---|---|
| label | The container wrapping the prefix, default, and suffix slots. |
| separator | The container wrapping the separator slot content. |
igc-breadcrumbs:
| Name | Description |
|---|---|
| --ig-breadcrumbs-gap | The gap between breadcrumb items. Defaults to 0.5rem. |
igc-breadcrumb:
| Name | Description |
|---|---|
| --ig-breadcrumb-link-color | The color of the breadcrumb link. Defaults to --ig-primary-500. |
| --ig-breadcrumb-link-color-hover | The hover color of the breadcrumb link. Defaults to --ig-primary-700. |
| --ig-breadcrumb-current-color | The color of the active (current) breadcrumb link. Defaults to --ig-gray-900. |
| --ig-breadcrumb-separator-color | The color of the separator. Defaults to --ig-gray-500. |
- Default rendering
- The container renders its slotted items with the
listARIA role - Each item renders with the
listitemARIA role - The default separator icon (
tree_expand) is used whenseparatoris not set
- The container renders its slotted items with the
- Passes the accessibility audit
- The container and its items pass the
@open-wc/testingaccessibility audit
- The container and its items pass the
- Default separator propagation
- Setting
separatoron the container updates the icon rendered by every descendant item - Changing
separatorat runtime updates all items reactively
- Setting
- Per-item override
- Content slotted into an item's
separatorslot replaces the default icon for that item only
- Content slotted into an item's
- Trailing separator
- The separator is hidden for the last item in the trail
- The separator remains visible for all other items
-
currentproperty- Defaults to
falsefor a newly created item - Reflects as the
currentattribute when set totrue - Toggling the property at runtime updates the attribute and the rendered state
- Defaults to
-
aria-current- Setting
currenttotruesetsaria-current="page"on the item - Setting
currentback tofalseremovesaria-current
- Setting
- Default slot
- Arbitrary content (links, spans, etc.) slotted into an item renders correctly
- Prefix and suffix slots
- Content slotted into
prefixrenders before the default slot content - Content slotted into
suffixrenders after the default slot content
- Content slotted into
- ARIA roles and properties
- The container has
role="list" - Each item has
role="listitem" -
aria-current="page"is present only on the item marked ascurrent
- The container has
- Screen reader support
- Screen readers announce the trail as a list and its items
- The current page is announced as such
- Right-to-Left
- The separator icon is mirrored when the component is rendered in an RTL context
- Empty or single-item trail
- A container with a single item renders without a separator
- A container with no items renders without errors
- Missing slot content
- An item with no slotted content does not break rendering
Following the breadcrumb navigation pattern, the following ARIA properties must be present:
-
igc-breadcrumbsmust have an ARIA role oflist. -
igc-breadcrumbmust have an ARIA role oflistitem. -
igc-breadcrumbmust havearia-current="page"when itscurrentproperty istrue. - Consuming applications should wrap
igc-breadcrumbsin a<nav aria-label="...">landmark to provide an accessible navigation label — the label belongs on the<nav>, not on the list, per the ARIA breadcrumb pattern.
Not applicable. The elements do not manage focus or intercept keyboard input; navigation relies entirely on the native behavior of the slotted interactive content (e.g. anchors).
The breadcrumb elements should work in a Right-to-Left context without additional setup or configuration — the default separator icon is mirrored automatically.