Breadcrumbs
The breadcrumbs component helps users to understand where they are within a website’s structure and move between levels.
<div class="govuk-breadcrumbs">
<ol class="govuk-breadcrumbs__list">
<li class="govuk-breadcrumbs__list-item">
<a class="govuk-breadcrumbs__link" href="#">Home</a>
</li>
<li class="govuk-breadcrumbs__list-item">
<a class="govuk-breadcrumbs__link" href="#">Passports, travel and living abroad</a>
</li>
<li class="govuk-breadcrumbs__list-item">
<a class="govuk-breadcrumbs__link" href="#">Travel abroad</a>
</li>
</ol>
</div>
{% from "govuk/components/breadcrumbs/macro.njk" import govukBreadcrumbs %}
{{ govukBreadcrumbs({
items: [
{
text: "Home",
href: "#"
},
{
text: "Passports, travel and living abroad",
href: "#"
},
{
text: "Travel abroad",
href: "#"
}
]
}) }}
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 breadcrumb should start with your ‘home’ page and end with the parent section of the current page.
There are 2 ways to use the breadcrumbs component. You can use HTML or, if you are using Nunjucks or the GOV.UK Prototype Kit, you can use the Nunjucks macro.
<div class="govuk-breadcrumbs">
<ol class="govuk-breadcrumbs__list">
<li class="govuk-breadcrumbs__list-item">
<a class="govuk-breadcrumbs__link" href="#">Home</a>
</li>
<li class="govuk-breadcrumbs__list-item">
<a class="govuk-breadcrumbs__link" href="#">Passports, travel and living abroad</a>
</li>
<li class="govuk-breadcrumbs__list-item">
<a class="govuk-breadcrumbs__link" href="#">Travel abroad</a>
</li>
</ol>
</div>
{% from "govuk/components/breadcrumbs/macro.njk" import govukBreadcrumbs %}
{{ govukBreadcrumbs({
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.
To do this, add a govuk-breadcrumbs--collapse-on-mobile
class to the outer <div>
element of the component HTML. Or if you’re using Nunjucks, add collapseOnMobile: true
to the Nunjucks macro as shown in this example.
<div class="govuk-breadcrumbs govuk-breadcrumbs--collapse-on-mobile">
<ol class="govuk-breadcrumbs__list">
<li class="govuk-breadcrumbs__list-item">
<a class="govuk-breadcrumbs__link" href="#">Home</a>
</li>
<li class="govuk-breadcrumbs__list-item">
<a class="govuk-breadcrumbs__link" href="#">Environment</a>
</li>
<li class="govuk-breadcrumbs__list-item">
<a class="govuk-breadcrumbs__link" href="#">Rural and countryside</a>
</li>
<li class="govuk-breadcrumbs__list-item">
<a class="govuk-breadcrumbs__link" href="#">Rural development and land management</a>
</li>
<li class="govuk-breadcrumbs__list-item">
<a class="govuk-breadcrumbs__link" href="#">Economic growth in rural areas</a>
</li>
</ol>
</div>
{% from "govuk/components/breadcrumbs/macro.njk" import govukBreadcrumbs %}
{{ govukBreadcrumbs({
collapseOnMobile: true,
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: '#'
}
]
}) }}
Help improve this page
To help make sure that this page is useful, relevant and up to date, you can:
- share your research or feedback on GitHub
- propose a change – read more about how to propose changes in GitHub
Need help?
If you’ve got a question about the GOV.UK Design System, contact the team.