1. Component Guide
  2. Copy to clipboard
  3. With data attributes
Copy to clipboard example

With data attributes

How it looks (preview)

How to call this example

<%= render "govuk_publishing_components/components/copy_to_clipboard", {
  label: "Copy and send this link to someone and they’ll be able to preview your draft on GOV.UK.",
  copyable_content: "http://www.example.org",
  input_data_attributes: {
    an_attribute: "for the input"
  button_text: "Copy link",
  button_data_attributes: {
    another_attribute: "for the button"
} %>