Copy to Clipboard

Copy to Clipboard allows the user to copy the current page URL to clipbaord to paste and share.

Install via NPM
npm install @bolt/components-copy-to-clipboard
{% include "@bolt-components-copy-to-clipboard/copy-to-clipboard.twig" with {
  text_to_copy: "http://bolt-design-system.com"
} only %}
Name Type Value(s) Description Default
attributes object

A Drupal-style attributes object with extra attributes to append to this component.

N/A
text string

DEPRECATED

This property has been renamed trigger_text

Copy Link
copiedText string

DEPRECATED

Use the custom_confirmation property instead if you need to change the confirmation text.

Copied!
iconSize string

DEPRECATED

Use custom_trigger, custom_transition, and custom_confirmation properties if you need to change icon size.

medium
url string

DEPRECATED

This property has been renamed text_to_copy

N/A
trigger_text string

Text to use for the inital copy button. Ignored if the custom_trigger property is used.

Copy Link
text_to_copy* string

The text to copy to the clipboard.

N/A
custom_trigger string OR object OR array

(optional) Custom content to show for the initial copy trigger. If you pass a link, set the URL to '#!' since it should not being followed.

N/A
custom_transition string OR object OR array

(optional) Custom content to show while copy is in progress. This content will be rotated while the copying happens, so it's recommended to pass an icon.

N/A
custom_confirmation string OR object OR array

(optional) Custom content to show after a successful copy.

N/A
Copied!
Copied!
Copied!
Copied!
Custom transition
Copied!
Copied!
Custom transition

Custom confirmation