Component

Breadcrumbs

Navigation trail showing the user's location in the site hierarchy. <wr-breadcrumbs-item> renders as a <li> containing either an <a> (when linked) or a <span aria-current="page"> (the final crumb). Separator is a CSS pseudo-element so it doesn't pollute the accessibility tree. Each item accepts an optional leading icon.

Import

import { WrBreadcrumbs, WrBreadcrumbsItem } from 'ngwr/breadcrumbs';

Playground

<wr-breadcrumbs separator="/" ariaLabel="Breadcrumbs">
  <wr-breadcrumbs-item icon="home" routerLink="/">Home</wr-breadcrumbs-item>
  <wr-breadcrumbs-item icon="folder" routerLink="/docs">Docs</wr-breadcrumbs-item>
  <wr-breadcrumbs-item routerLink="/docs/components">Components</wr-breadcrumbs-item>
  <wr-breadcrumbs-item>Breadcrumbs</wr-breadcrumbs-item>
</wr-breadcrumbs>

Customize

Separator
Aria Label

API

NameDescriptionTypeDefault
<wr-breadcrumbs>Container — renders <nav aria-label><ol>…</ol></nav>.component
separatorGlyph rendered between items via CSS ::before. Any short string.string'/'
ariaLabelAccessible name for the nav landmark. Falls back to the breadcrumbs.label catalog key, then Breadcrumbs.string | nullnull
<wr-breadcrumbs-item>Single row. Renders <a> when linked, <span aria-current="page"> otherwise.component
iconOptional leading icon (from the wr-icon registry) rendered inline before the label.WrIconName | nullnull
routerLinkAngular router target. Wins over href.string | readonly unknown[] | nullnull
hrefPlain anchor href.string | nullnull
externalOpen href in a new tab (adds target="_blank" rel="noreferrer noopener").booleanfalse
CSS — --wr-breadcrumbs-separatorOverride the separator glyph.string'/'
CSS — --wr-breadcrumbs-gapSpacing between items and separators.length0.5rem
CSS — --wr-breadcrumbs-link-colorLink colour.colorvar(--wr-color-primary-ink)
CSS — --wr-breadcrumbs-current-colorCurrent-page (last) item colour.colorvar(--wr-color-dark)
CSS — --wr-breadcrumbs-separator-colorSeparator glyph colour.colorrgba(var(--wr-color-dark-rgb), 0.3)

CSS variables

Custom properties ngwr/breadcrumbs publishes. Each default below is declared on the component's own selector, so a :root override is shadowed by it — set them on that selector, on a wrapper you scope yourself, or inline on the element. Unlike the BEM class names, these are the supported way to restyle the component.

VariableDefaultDeclared on
--wr-breadcrumbs-colorrgba(var(--wr-color-on-surface-rgb), 0.6).wr-breadcrumbs
--wr-breadcrumbs-current-colorvar(--wr-color-on-surface).wr-breadcrumbs
--wr-breadcrumbs-gap0.5rem.wr-breadcrumbs
--wr-breadcrumbs-link-colorvar(--wr-color-primary-ink).wr-breadcrumbs
--wr-breadcrumbs-separator'/'.wr-breadcrumbs
--wr-breadcrumbs-separator-colorrgba(var(--wr-color-on-surface-rgb), 0.3).wr-breadcrumbs