Components

Breadcrumbs

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

Props
Name Type Default Description
id string - 'id' attribute to place on the base HTML element
classBlock string - Block name override in BEM style classes applied to all elements
classModifiers other - BEM style modifiers to apply to the base HTML element
className string - Extra classes to apply to the base HTML element
items other - REQUIRED. List 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.

Stories

Standard

Standard Breadcrumbs.

<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"
        href="#"
      >
        Home
      </a>
    </li>
    <li
      class="govuk-breadcrumbs__list__item govuk-breadcrumbs__list__item--active"
    >
      <a
        class="govuk-breadcrumbs__list__link"
        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"
        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"
        href="#"
      >
        Home
      </a>
    </li>
    <li
      class="govuk-breadcrumbs__list__item govuk-breadcrumbs__list__item--active"
    >
      <a
        class="govuk-breadcrumbs__list__link"
        href="#"
      >
        Environment
      </a>
    </li>
    <li
      class="govuk-breadcrumbs__list__item govuk-breadcrumbs__list__item--active"
    >
      <a
        class="govuk-breadcrumbs__list__link"
        href="#"
      >
        Rural and countryside
      </a>
    </li>
    <li
      class="govuk-breadcrumbs__list__item govuk-breadcrumbs__list__item--active"
    >
      <a
        class="govuk-breadcrumbs__list__link"
        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"
        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: "#",
    },
  ]}
/>