1. Government Frontend Component Guide
  2. Button
  3. With data attributes
Button example

With data attributes

How it looks

How to call this example

<%= render "govuk_publishing_components/components/button", {
  text: "Track this!",
  margin_bottom: true,
  data_attributes: {
    module: "cross-domain-tracking",
    "tracking-code": "GA-123ABC",
    "tracking-name": "transactionTracker"
  }
} %>