1. Component Guide
  2. Layout header
  3. With navigation link data attributes
Layout header example

With navigation link data attributes

Supports adding data attributes i.e for tracking

How it looks (preview)

How to call this example

<%= render "govuk_publishing_components/components/layout_header", {
  navigation_items: [
    {
      text: "Departments",
      href: "item-1",
      data: {
        module: "a custom attribute",
        something_else: "some other custom attribute"
      }
    },
    {
      text: "Worldwide",
      href: "item-2"
    }
  ]
} %>