1. Component Guide
  2. Big number
  3. With data attributes
Big number example

With data attributes

If a href attribute is present, data attributes will apply to the span containing the number value (see below).

This will also not automatically apply a gem-track-click module attribute if the data attributes pertain to click tracking. Remember to apply this outside the component call in a surrounding element, if using.

How it looks (preview)

How to call this example

<%= render "govuk_publishing_components/components/big_number", {
  number: 23,
  label: "Ministerial departments",
  href: "/government/organisations#ministerial_departments",
  data_attributes: {
    "track-category": "homepageClicked",
    "track-action": "departmentsLink",
    "track-label": "/government/organisations#ministerial_departments",
    "track-dimension": "23 Ministerial departments",
    "track-dimension-index": 29
  }
} %>