Copy-to-clipboard

Available Sass Variables and default values

$copy-cursor: copy
$copy-copied-background-color: rgba(0,0,0,.3)
$copy-copied-color: $wt
$copy-font-size: $font-size-small
$copy-copied-text: "Copied"

Examples

Basic Setup

To enable click-to-copy functionality on an element, add a [data-clipboard-text] attribute with the value set to the text you want to copy to the clipboard.

span data-clipboard-text="TEXT" Click to copy the secret message to the clipboard
Click to copy the secret message to the clipboard