1. Component Guide
  2. Print link
  3. With data attributes
Print link example

With data attributes

Data attributes can be passed to the component as shown.

Note that the component does not include built in tracking. If this is required consider using the track click script.

How it looks (preview)

How to call this example

<%= render "govuk_publishing_components/components/print_link", {
  data_attributes: {
    "track-category": "printButton",
    "track-action": "clicked",
    "track-label": "Print this page"
  }
} %>