Create

Navigation

Breadcrumb

Copy page View as Markdown Open in ChatGPT Open in Claude

Displays the path to the current resource using a hierarchy of links.

Usage#

app.component.ts
import { WDS_BREADCRUMB } from '@wds/angular/breadcrumb';

Examples#

Default#

Home Components Breadcrumb

Separator#

separator changes the text of the automatic separators. For an icon, place wds-breadcrumb-separator between the items: the automatic separators turn off.

Home Components Breadcrumb Home Components Breadcrumb

Without href the link renders a native <button>, so it can be a wds-dropdown trigger.

Home Components Documentation Themes Blocks Breadcrumb

Ellipsis#

Collapses the middle of a long trail. Screen readers get the label of the ellipsis.

Home Components Breadcrumb

With icon#

An icon-only link needs a label: it becomes its accessible name.

Components Breadcrumb

Size#

Home Components Breadcrumb Home Components Breadcrumb Home Components Breadcrumb

Align#

Home Components Breadcrumb Home Components Breadcrumb Home Components Breadcrumb

In Angular routerLink works on wds-breadcrumb-link as on <a>: it sets href and leaves Ctrl/⌘+click to the browser.

HomeComponentsBreadcrumb

API References#

wds-breadcrumb#

Breadcrumb: the path to the current page as a list of links (<nav> with an <ol>). Items get a separator (chevron or separator text) automatically. A wds-breadcrumb-separator placed between the items turns the automatic separators off.

Attributes

AttributeTypeDefaultDescription
labelstring'Breadcrumb'Accessible name of the navigation (aria-label of the <nav>).
sizeWdsBreadcrumbSize'md'Text size.
alignWdsBreadcrumbAlign'start'Horizontal alignment of the items.
wrapWdsBreadcrumbWrap'wrap'nowrap keeps the items on one line.
separatorstring''Text of the automatic separator (e.g. /). Empty: a chevron icon.

Slots

SlotDescription
(default)wds-breadcrumb-item and optionally wds-breadcrumb-separator elements.

CSS parts (::part)

PartDescription
navThe native <nav>.
listThe native <ol>.

CSS custom properties

PropertyDescription
--wds-breadcrumb-gapSpace between items and separators (6px, 10px from 640px).

wds-breadcrumb-item#

Breadcrumb item (role="listitem"). Followed by a separator unless it is the last item or the trail has its own wds-breadcrumb-separator elements.

Slots

SlotDescription
(default)wds-breadcrumb-link, wds-breadcrumb-page, wds-breadcrumb-ellipsis or a wds-dropdown.

CSS parts (::part)

PartDescription
separatorThe automatic separator.

Link to an ancestor page. With href it renders a native <a>, without it a native <button> (e.g. a wds-dropdown trigger). In Angular routerLink works as on <a>: it sets href. aria-expanded, aria-haspopup and aria-label on the host are forwarded to the native element.

Attributes

AttributeTypeDefaultDescription
hrefstring | undefinedURL of the page. Without it the link renders as a <button>.
targetstring | undefined
labelstring | undefinedAccessible label (aria-label), required for icon-only content.

Slots

SlotDescription
(default)Link content (text, <svg> icon).

CSS parts (::part)

PartDescription
linkThe native <a> or <button>.

wds-breadcrumb-page#

The current page: the last, non-interactive item of the trail (aria-current="page").

Slots

SlotDescription
(default)Page name.

wds-breadcrumb-separator#

Separator placed by hand between wds-breadcrumb-item elements. Its presence turns off the automatic separators of the trail. Hidden from screen readers.

Slots

SlotDescription
(default)Separator content (text or <svg>). Default: a chevron.

wds-breadcrumb-ellipsis#

Ellipsis in place of collapsed items. The icon is hidden, screen readers get label. Put it in a wds-breadcrumb-link to use it as a wds-dropdown trigger.

Attributes

AttributeTypeDefaultDescription
colorWdsBreadcrumbEllipsisColor'muted'muted inherits the trail color, strong uses the foreground color.
labelstring'More breadcrumbs'Text for screen readers.

Accessibility#

Screen reader#

wds-breadcrumb renders a <nav> landmark named by label (default Breadcrumb). When a page has more than one breadcrumb, give each a different label.

The items form an ordered list: an <ol> with listitem elements. Separators, automatic or wds-breadcrumb-separator, are hidden from screen readers.

wds-breadcrumb-page marks the current page with aria-current="page". wds-breadcrumb-ellipsis hides its icon and is read as its label (default More breadcrumbs).

An icon-only wds-breadcrumb-link needs a label: it becomes the accessible name of the link. A link without href is a native <button>; as a wds-dropdown trigger it gets aria-haspopup and aria-expanded.

Keyboard support#

KeyFunction
TabMoves focus to the next link. Links follow the page tab sequence.
Shift + TabMoves focus to the previous link.
EnterFollows the focused link, or opens the menu of a link without href.
SpaceOpens the menu of a link without href.
Footer