A named navigation landmark containing hierarchical native links and a non-link current page. Middle ancestors can be collapsed and expanded without menu-specific keyboard behavior. Follows the APG breadcrumb pattern.
<qds-breadcrumb id="company-path" label="Company location" max-items="3"></qds-breadcrumb>
<script type="module">
import '/assets/components/breadcrumb/qds-breadcrumb.js';
document.querySelector('#company-path').items = [
{ label: 'Portfolio', href: '#/portfolio' },
{ label: 'Companies', href: '#/portfolio/companies' },
{ label: 'Redwood Basin Resources' }
];
</script>
| Property | Attribute | Type / default | Contract |
|---|---|---|---|
items |
property only | {label: string; href?: string}[], empty |
Ordered path. Last item is current, even if it supplies an href. Input/output records are copied. Invalid/empty labels are omitted; unsafe URLs become text. |
label |
label |
string, Breadcrumb | Navigation accessible name. |
maxItems |
max-items |
number, 4 | Minimum 2; count excludes overflow button. Keeps first and final ancestors/current item visible. |
expanded |
expanded |
boolean, false | Reveal/hide middle ancestors. Programmatic updates do not emit user events. |
Events bubble and cross shadow boundaries. qds-toggle has {expanded, component} after a user toggle. Cancelable qds-navigate has {index, item, component}; prevent default to delegate routing. Otherwise links retain native navigation, modifier keys, context menu and Tab/Enter behavior. Links accept relative, fragment and HTTP(S) URLs; other protocols and malformed URLs render as plain text. Labels are rendered as text.
The current text has aria-current="page"; visual separators are decorative. The overflow button has an accessible name, expanded state and controls references to hidden ancestors. Focus stays on the replacement overflow button when toggled. When updates hide/remove a focused ancestor, focus moves to an available overflow button, visible link or navigation context. Empty paths hide the landmark. Reconnection reinstalls a single listener.
Parts: navigation, list, link, current, overflow. Existing theme tokens provide colors, focus and borders; long paths wrap. Links and the overflow control have minimum 44px targets. See the demo for controlled expansion, long paths, cancelled routing and empty paths.
Generated QdsBreadcrumbComponent accepts a typed array through [items]. Northwind’s company-detail route (/#/portfolio/companies/co-redwood) presents Portfolio > Companies > company name; ancestor links navigate within the app. The component is also discoverable in the generated catalog.