Breadcrumbs example
Default
How it looks
(preview)
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "BreadcrumbList",
"itemListElement": [
{
"@type": "ListItem",
"position": 1,
"item": {
"name": "Section",
"@id": "https://www.gov.uk/section"
}
},
{
"@type": "ListItem",
"position": 2,
"item": {
"name": "Sub-section",
"@id": "https://www.gov.uk/section/sub-section"
}
}
]
}
</script>
<nav data-module="ga4-link-tracker" aria-label="Breadcrumb" class="gem-c-breadcrumbs govuk-breadcrumbs govuk-breadcrumbs--collapse-on-mobile">
<ol class="govuk-breadcrumbs__list">
<li class="govuk-breadcrumbs__list-item">
<a data-ga4-link="{"event_name":"navigation","type":"breadcrumb","index_link":"1","index_total":"2"}" class="govuk-breadcrumbs__link" href="/section">Section</a>
</li>
<li class="govuk-breadcrumbs__list-item">
<a data-ga4-link="{"event_name":"navigation","type":"breadcrumb","index_link":"2","index_total":"2"}" class="govuk-breadcrumbs__link" href="/section/sub-section">Sub-section</a>
</li>
</ol>
</nav>
How to call this example
<%= render "govuk_publishing_components/components/breadcrumbs", {
collapse_on_mobile: true,
breadcrumbs: [
{
title: "Section",
url: "/section"
},
{
title: "Sub-section",
url: "/section/sub-section"
}
]
} %>