Dojo NG is being built in the open, one section at a time — follow along on Heptapod.

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-tree or a dj-navigate that 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.
  • items is ignored while track is on and history is installed. With no history installed, track does nothing and items is shown as plain links.
  • A plain click on a crumb dispatches dj-navigate with 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.

Try it in the playground

@dojo-ng/breadcrumb-group · v0.2.0

npm install @dojo-ng/breadcrumb-group

import "@dojo-ng/breadcrumb-group";

Properties

PropertyAttributeTypeDefault
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

EventDescription
dj-navigatedetail { path, label, trail }

CSS parts

Style these with dj-breadcrumb-group::part(name).

list

CSS custom properties

PropertyDefaultDescription
--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; }