API REFERENCE · NAVIGATION
<dj-breadcrumb-group>
A breadcrumb trail.
Give it items for a trail you control. Or set track and it follows the app's navigation history, with no list to maintain:
- With a trail on the location (a tracked
dj-treeor adj-navigatethat carried one), there is one crumb per trail entry and the last is the current page. - Without one, the path is split into segments and each crumb is
resolveTitle(prefix), or the decoded segment when that returns nothing. itemsis ignored whiletrackis on and history is installed. With no history installed,trackdoes nothing anditemsis shown as plain links.- A plain click on a crumb dispatches
dj-navigatewith that crumb's path and the trail up to it, so Back and a tracked tree follow. Ctrl-, Cmd- and middle-click keep the browser's link behavior.
The landmark's name is "Breadcrumb", translated. The separator is a CSS custom property, not text a screen reader reads.
Needs @dojo-ng/history installed for track; without it nothing throws.
npm install @dojo-ng/breadcrumb-group
import "@dojo-ng/breadcrumb-group";
Properties
| Property | Attribute | Type | Default |
|---|---|---|---|
items |
items |
Crumb[] |
[] |
trackDerive the crumbs from the navigation location instead of items. Needs @dojo-ng/history installed. |
track |
boolean |
false |
resolveTitleNames a path in the no-trail case. Returns undefined to fall back to the path segment. JS only. |
Property only | (path: string) => string | undefined |
None |
Events
| Event | Description |
|---|---|
dj-navigate | detail { path, label, trail } |
CSS parts
Style these with dj-breadcrumb-group::part(name).
list
CSS custom properties
| Property | Default | Description |
|---|---|---|
--dj-breadcrumb-separator | "/" | The text drawn between crumbs, for example "›". |
Types
The types that the properties above use, as they are declared in the source.
Crumb
export interface Crumb { label: string; href?: string; current?: boolean; }