<olclass="govuk-breadcrumbs__list"><liclass="govuk-breadcrumbs__list-item"><aclass="govuk-breadcrumbs__link"href="#">Home</a></li><liclass="govuk-breadcrumbs__list-item"><aclass="govuk-breadcrumbs__link"href="#">Passports, travel and living abroad</a></li><liclass="govuk-breadcrumbs__list-item"><aclass="govuk-breadcrumbs__link"href="#">Travel abroad</a></li></ol></div>
<p>
Use options to customise the appearance, content and behaviour of a component when using a macro, for example, changing the text.
</p>
<p>
Some options are required for the macro to work; these are marked as "Required" in the option description.
</p>
<p>
If you're using Nunjucks macros in production with "html" options, or ones ending with "html", you must sanitise the HTML to protect against <a href="https://developer.mozilla.org/en-US/docs/Glossary/Cross-site_scripting">cross-site scripting exploits</a>.
</p>
<table class="govuk-table app-options__table" id="options-breadcrumbs-example--primary">
<caption class="govuk-table__caption govuk-heading-m govuk-visually-hidden">Primary options</caption>
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Name</th>
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Type</th>
<th class="govuk-table__header" scope="col">Description</th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">items</th>
<td class="govuk-table__cell ">array</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
Array of breadcrumbs item objects.
See <a href="#options-breadcrumbs-example--items">items</a>.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">classes</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
Classes to add to the breadcrumbs container.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">collapseOnMobile</th>
<td class="govuk-table__cell ">boolean</td>
<td class="govuk-table__cell ">
When true, the breadcrumbs will collapse to the first and last item only on tablet breakpoint and below.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">attributes</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
HTML attributes (for example data attributes) to add to the breadcrumbs container.
</td>
</tr>
</tbody>
</table>
<table class="govuk-table app-options__table" id="options-breadcrumbs-example--items">
<caption class="govuk-table__caption govuk-heading-m ">Options for items</caption>
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Name</th>
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Type</th>
<th class="govuk-table__header" scope="col">Description</th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">text</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
If <code>html</code> is set, this is not required. Text to use within the breadcrumbs item. If <code>html</code> is provided, the <code>text</code> option will be ignored.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">html</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
If <code>text</code> is set, this is not required. HTML to use within the breadcrumbs item. If <code>html</code> is provided, the <code>text</code> option will be ignored.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">href</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
Link for the breadcrumbs item. If not specified, breadcrumbs item is a normal list item.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">attributes</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
HTML attributes (for example data attributes) to add to the individual crumb.
</td>
</tr>
</tbody>
</table>
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
Always place breadcrumbs at the top of a page, before the <main> element. Placing them here means that the 'Skip to main content' link allows the user to skip all navigation links, including breadcrumbs.
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.
<olclass="govuk-breadcrumbs__list"><liclass="govuk-breadcrumbs__list-item"><aclass="govuk-breadcrumbs__link"href="#">Home</a></li><liclass="govuk-breadcrumbs__list-item"><aclass="govuk-breadcrumbs__link"href="#">Passports, travel and living abroad</a></li><liclass="govuk-breadcrumbs__list-item"><aclass="govuk-breadcrumbs__link"href="#">Travel abroad</a></li></ol></div>
<p>
Use options to customise the appearance, content and behaviour of a component when using a macro, for example, changing the text.
</p>
<p>
Some options are required for the macro to work; these are marked as "Required" in the option description.
</p>
<p>
If you're using Nunjucks macros in production with "html" options, or ones ending with "html", you must sanitise the HTML to protect against <a href="https://developer.mozilla.org/en-US/docs/Glossary/Cross-site_scripting">cross-site scripting exploits</a>.
</p>
<table class="govuk-table app-options__table" id="options-breadcrumbs-second-example--primary">
<caption class="govuk-table__caption govuk-heading-m govuk-visually-hidden">Primary options</caption>
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Name</th>
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Type</th>
<th class="govuk-table__header" scope="col">Description</th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">items</th>
<td class="govuk-table__cell ">array</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
Array of breadcrumbs item objects.
See <a href="#options-breadcrumbs-second-example--items">items</a>.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">classes</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
Classes to add to the breadcrumbs container.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">collapseOnMobile</th>
<td class="govuk-table__cell ">boolean</td>
<td class="govuk-table__cell ">
When true, the breadcrumbs will collapse to the first and last item only on tablet breakpoint and below.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">attributes</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
HTML attributes (for example data attributes) to add to the breadcrumbs container.
</td>
</tr>
</tbody>
</table>
<table class="govuk-table app-options__table" id="options-breadcrumbs-second-example--items">
<caption class="govuk-table__caption govuk-heading-m ">Options for items</caption>
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Name</th>
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Type</th>
<th class="govuk-table__header" scope="col">Description</th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">text</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
If <code>html</code> is set, this is not required. Text to use within the breadcrumbs item. If <code>html</code> is provided, the <code>text</code> option will be ignored.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">html</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
If <code>text</code> is set, this is not required. HTML to use within the breadcrumbs item. If <code>html</code> is provided, the <code>text</code> option will be ignored.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">href</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
Link for the breadcrumbs item. If not specified, breadcrumbs item is a normal list item.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">attributes</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
HTML attributes (for example data attributes) to add to the individual crumb.
</td>
</tr>
</tbody>
</table>
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="app-example app-example--tabs">
<div class="app-example__toolbar">
<a href="/components/breadcrumbs/collapse-mobile/index.html" class="app-example__new-window" target="_blank">
Open this
<span class="govuk-visually-hidden">breadcrumbs that collapse on mobile</span>
example in a new tab
</a>
</div>
<iframe title="Breadcrumbs that collapse on mobile example" data-module="app-example-frame" class="app-example__frame app-example__frame--resizable" src="/components/breadcrumbs/collapse-mobile/index.html" frameBorder="0" loading="lazy"></iframe>
</div>
<span id="options-breadcrumbs-that-collapse-on-mobile-example"></span>
<ul class="app-tabs" role="tablist">
<li class="app-tabs__item js-tabs__item" role="presentation"><a href="#breadcrumbs-that-collapse-on-mobile-example-html" role="tab" aria-controls="breadcrumbs-that-collapse-on-mobile-example-html" data-track="tab-html">HTML</a></li>
<li class="app-tabs__item js-tabs__item" role="presentation"><a href="#breadcrumbs-that-collapse-on-mobile-example-nunjucks" role="tab" aria-controls="breadcrumbs-that-collapse-on-mobile-example-nunjucks" data-track="tab-nunjucks">Nunjucks</a></li>
</ul>
<div class="app-tabs__heading js-tabs__heading"><a href="#breadcrumbs-that-collapse-on-mobile-example-html" aria-controls="breadcrumbs-that-collapse-on-mobile-example-html" data-track="tab-html">HTML</a></div>
<div class="app-tabs__container js-tabs__container" id="breadcrumbs-that-collapse-on-mobile-example-html" role="tabpanel">
<div class="app-example__code">
<pre data-module="app-copy" tabindex="0"><code class="hljs html"><span class="hljs-tag"><<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"govuk-breadcrumbs govuk-breadcrumbs--collapse-on-mobile"</span>></span>
<olclass="govuk-breadcrumbs__list"><liclass="govuk-breadcrumbs__list-item"><aclass="govuk-breadcrumbs__link"href="#">Home</a></li><liclass="govuk-breadcrumbs__list-item"><aclass="govuk-breadcrumbs__link"href="#">Environment</a></li><liclass="govuk-breadcrumbs__list-item"><aclass="govuk-breadcrumbs__link"href="#">Rural and countryside</a></li><liclass="govuk-breadcrumbs__list-item"><aclass="govuk-breadcrumbs__link"href="#">Rural development and land management</a></li><liclass="govuk-breadcrumbs__list-item"><aclass="govuk-breadcrumbs__link"href="#">Economic growth in rural areas</a></li></ol></div>
<p>
Use options to customise the appearance, content and behaviour of a component when using a macro, for example, changing the text.
</p>
<p>
Some options are required for the macro to work; these are marked as "Required" in the option description.
</p>
<p>
If you're using Nunjucks macros in production with "html" options, or ones ending with "html", you must sanitise the HTML to protect against <a href="https://developer.mozilla.org/en-US/docs/Glossary/Cross-site_scripting">cross-site scripting exploits</a>.
</p>
<table class="govuk-table app-options__table" id="options-breadcrumbs-that-collapse-on-mobile-example--primary">
<caption class="govuk-table__caption govuk-heading-m govuk-visually-hidden">Primary options</caption>
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Name</th>
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Type</th>
<th class="govuk-table__header" scope="col">Description</th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">items</th>
<td class="govuk-table__cell ">array</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
Array of breadcrumbs item objects.
See <a href="#options-breadcrumbs-that-collapse-on-mobile-example--items">items</a>.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">classes</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
Classes to add to the breadcrumbs container.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">collapseOnMobile</th>
<td class="govuk-table__cell ">boolean</td>
<td class="govuk-table__cell ">
When true, the breadcrumbs will collapse to the first and last item only on tablet breakpoint and below.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">attributes</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
HTML attributes (for example data attributes) to add to the breadcrumbs container.
</td>
</tr>
</tbody>
</table>
<table class="govuk-table app-options__table" id="options-breadcrumbs-that-collapse-on-mobile-example--items">
<caption class="govuk-table__caption govuk-heading-m ">Options for items</caption>
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Name</th>
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Type</th>
<th class="govuk-table__header" scope="col">Description</th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">text</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
If <code>html</code> is set, this is not required. Text to use within the breadcrumbs item. If <code>html</code> is provided, the <code>text</code> option will be ignored.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">html</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
If <code>text</code> is set, this is not required. HTML to use within the breadcrumbs item. If <code>html</code> is provided, the <code>text</code> option will be ignored.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">href</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
Link for the breadcrumbs item. If not specified, breadcrumbs item is a normal list item.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">attributes</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
HTML attributes (for example data attributes) to add to the individual crumb.
</td>
</tr>
</tbody>
</table>