Breadcrumbs example

With border and collapse on mobile

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"
      }
    },
    {
      "@type": "ListItem",
      "position": 3,
      "item": {
        "name": "Sub-sub-section",
        "@id": "https://www.gov.uk/section/sub-section/sub-section"
      }
    }
  ]
}
</script>

<nav data-module="ga4-link-tracker" aria-label="Breadcrumb" class="gem-c-breadcrumbs govuk-breadcrumbs govuk-breadcrumbs--collapse-on-mobile gem-c-breadcrumbs--border-bottom">
  <ol class="govuk-breadcrumbs__list">
        <li class="govuk-breadcrumbs__list-item">
          <a data-ga4-link="{&quot;event_name&quot;:&quot;navigation&quot;,&quot;type&quot;:&quot;breadcrumb&quot;,&quot;index_link&quot;:&quot;1&quot;,&quot;index_total&quot;:&quot;3&quot;}" class="govuk-breadcrumbs__link" href="/section">Section</a>
        </li>
        <li class="govuk-breadcrumbs__list-item">
          <a data-ga4-link="{&quot;event_name&quot;:&quot;navigation&quot;,&quot;type&quot;:&quot;breadcrumb&quot;,&quot;index_link&quot;:&quot;2&quot;,&quot;index_total&quot;:&quot;3&quot;}" class="govuk-breadcrumbs__link" href="/section/sub-section">Sub-section</a>
        </li>
        <li class="govuk-breadcrumbs__list-item">
          <a data-ga4-link="{&quot;event_name&quot;:&quot;navigation&quot;,&quot;type&quot;:&quot;breadcrumb&quot;,&quot;index_link&quot;:&quot;3&quot;,&quot;index_total&quot;:&quot;3&quot;}" class="govuk-breadcrumbs__link" href="/section/sub-section/sub-section">Sub-sub-section</a>
        </li>
  </ol>
</nav>

How to call this example

<%= render "govuk_publishing_components/components/breadcrumbs", {
  border: "bottom",
  collapse_on_mobile: true,
  breadcrumbs: [
    {
      title: "Section",
      url: "/section"
    },
    {
      title: "Sub-section",
      url: "/section/sub-section"
    },
    {
      title: "Sub-sub-section",
      url: "/section/sub-section/sub-section"
    }
  ]
} %>