Components

Breadcrumbs

The breadcrumbs component helps users to understand where they are within a website’s structure and move between levels.

Props
NameTypeDefaultDescription
idother'id' attribute to place on the base HTML element
classBlockotherBlock name override in BEM style classes applied to all elements
classModifiersotherBEM style modifiers to apply to the base HTML element
classNameotherExtra classes to apply to the base HTML element
itemsotherList of links to choose from

When to use this component

Use the breadcrumbs component when you need to help users understand and move between the multiple levels of a website.

When not to use this component

Do not use the breadcrumbs component on websites with a flat structure, or to show progress through a linear journey or transaction.

If you’re using other navigational elements on the page, such as a sidebar, consider whether your users need the additional support of breadcrumbs.

How it works

The breadcrumbs component should include the user’s current page, which should be visually different from the other links in the breadcrumb.

<div class="govuk-breadcrumbs">
  <ol class="govuk-breadcrumbs__list">
    <li
      class="govuk-breadcrumbs__list__item govuk-breadcrumbs__list__item--active"
    >
      <a
        class="govuk-breadcrumbs__list__link govuk-breadcrumbs__list__link--active"
        href="#"
      >
        Home
      </a>
    </li>
    <li
      class="govuk-breadcrumbs__list__item govuk-breadcrumbs__list__item--active"
    >
      <a
        class="govuk-breadcrumbs__list__link govuk-breadcrumbs__list__link--active"
        href="#"
      >
        Passports, travel and living abroad
      </a>
    </li>
    <li
      class="govuk-breadcrumbs__list__item govuk-breadcrumbs__list__item--active"
    >
      <a
        class="govuk-breadcrumbs__list__link govuk-breadcrumbs__list__link--active"
        href="#"
      >
        Travel abroad
      </a>
    </li>
  </ol>
</div>
<Breadcrumbs
  items={[
    {
      text: "Home",
      href: "#",
    },
    {
      text: "Passports, travel and living abroad",
      href: "#",
    },
    {
      text: "Travel abroad",
      href: "#",
    },
  ]}
/>

Collapsing breadcrumbs on mobile devices

If you have long breadcrumbs you can configure the component to only show the first and last items on mobile devices.

<div
  class="govuk-breadcrumbs govuk-breadcrumbs--collapse-on-mobile"
>
  <ol class="govuk-breadcrumbs__list">
    <li
      class="govuk-breadcrumbs__list__item govuk-breadcrumbs__list__item--active"
    >
      <a
        class="govuk-breadcrumbs__list__link govuk-breadcrumbs__list__link--active"
        href="#"
      >
        Home
      </a>
    </li>
    <li
      class="govuk-breadcrumbs__list__item govuk-breadcrumbs__list__item--active"
    >
      <a
        class="govuk-breadcrumbs__list__link govuk-breadcrumbs__list__link--active"
        href="#"
      >
        Environment
      </a>
    </li>
    <li
      class="govuk-breadcrumbs__list__item govuk-breadcrumbs__list__item--active"
    >
      <a
        class="govuk-breadcrumbs__list__link govuk-breadcrumbs__list__link--active"
        href="#"
      >
        Rural and countryside
      </a>
    </li>
    <li
      class="govuk-breadcrumbs__list__item govuk-breadcrumbs__list__item--active"
    >
      <a
        class="govuk-breadcrumbs__list__link govuk-breadcrumbs__list__link--active"
        href="#"
      >
        Rural development and land management
      </a>
    </li>
    <li
      class="govuk-breadcrumbs__list__item govuk-breadcrumbs__list__item--active"
    >
      <a
        class="govuk-breadcrumbs__list__link govuk-breadcrumbs__list__link--active"
        href="#"
      >
        Economic growth in rural areas
      </a>
    </li>
  </ol>
</div>
<Breadcrumbs
  classModifiers="collapse-on-mobile"
  items={[
    {
      text: "Home",
      href: "#",
    },
    {
      text: "Environment",
      href: "#",
    },
    {
      text: "Rural and countryside",
      href: "#",
    },
    {
      text: "Rural development and land management",
      href: "#",
    },
    {
      text: "Economic growth in rural areas",
      href: "#",
    },
  ]}
/>

Breadcrumbs on dark backgrounds

Use the govuk-breadcrumbs--inverse modifier class to show white links and arrows on dark backgrounds – for example, in headers, custom components, and patterns with darker backgrounds.

Make sure all users can see the breadcrumbs – the background colour must have a contrast ratio of at least 4.5:1 with white.

<div class="govuk-panel govuk-panel--interruption">
  <div class="govuk-panel__body">
    <div
      class="govuk-breadcrumbs govuk-breadcrumbs--inverse"
    >
      <ol class="govuk-breadcrumbs__list">
        <li
          class="govuk-breadcrumbs__list__item govuk-breadcrumbs__list__item--active"
        >
          <a
            class="govuk-breadcrumbs__list__link govuk-breadcrumbs__list__link--active"
            href="#"
          >
            Home
          </a>
        </li>
        <li
          class="govuk-breadcrumbs__list__item govuk-breadcrumbs__list__item--active"
        >
          <a
            class="govuk-breadcrumbs__list__link govuk-breadcrumbs__list__link--active"
            href="#"
          >
            Passports, travel and living abroad
          </a>
        </li>
        <li
          class="govuk-breadcrumbs__list__item govuk-breadcrumbs__list__item--active"
        >
          <a
            class="govuk-breadcrumbs__list__link govuk-breadcrumbs__list__link--active"
            href="#"
          >
            Travel abroad
          </a>
        </li>
      </ol>
    </div>
  </div>
</div>
<Panel classModifiers="interruption">
  <Breadcrumbs
    classModifiers="inverse"
    items={[
      {
        text: "Home",
        href: "#",
      },
      {
        text: "Passports, travel and living abroad",
        href: "#",
      },
      {
        text: "Travel abroad",
        href: "#",
      },
    ]}
  />
</Panel>