Navigation

Breadcrumb

Simple breadcrumb

Core

Try it yourself on the playground

Playground

Standardised

Try it yourself on the playground

Playground

Harmonised

Try it yourself on the playground

Playground

Long breadcrumb

When there are more than 3 items, the breadcrumb should be collapsed by default and items should be displayed if there's enough space.

The first item and the last 2 items should always be visible.

Core

Try it yourself on the playground

Playground

Standardised

Try it yourself on the playground

Playground

Harmonised

Try it yourself on the playground

Playground

JS behaviour

Auto initialisation

In order to automatically initalise the JS behaviour, add data-ecl-auto-init="BreadcrumbCore" (or BreadcrumbStandardised, or BreadcrumbHarmonised) to your component's markup:

<nav
  class="ecl-breadcrumb"
  aria-label="You are here:"
  data-ecl-breadcrumb-core
  data-ecl-auto-init="BreadcrumbCore"
>
  ...
</nav>

Don't forget to call ECL.autoInit() when your page is ready!

Manual initialisation

When the document is ready, query the element. For example, you can use document.querySelector('[data-ecl-breadcrumb-core]') if you only have 1 breadcrumb in the page.

Then, instantiate the BreadcrumbCore (or BreadcrumbStandardised, or BreadcrumbHarmonised) component and call init():

var elt = document.querySelector('[data-ecl-breadcrumb-core]');
var breadcrumb = new ECL.BreadcrumbCore(elt);
breadcrumb.init();