react-zeroclipboard-mixin
React mixin for automatic binding of the ZeroClipboard client to the clipboard action DOM elements
Installation
npm install --save react-zeroclipboard-mixin
Demo
Demo is available here
Usage
ZeroClipboardMixin is available as a CommonJS module (so that you could simply require
it with Browserify, Webpack, etc.) or as UMD bundle (could be used as a AMD, CommonJS or browser global).
UMD bundle includes ZeroClipboard and could be found under the ./dist/zeroclipboard-mixin.bundle.js
.
var React = ;var ZeroClipboardMixin = ; // configure ZeroClipboard before using mixinZeroClipboardMixinZeroClipboard; var MyCopyButton = React; React
Notes
- Doesn't support top-level elements as a clipboard control elements.
ZeroClipboard
is available as a property of mixinZeroClipboardMixin.ZeroClipboard
.- You always have to configure
ZeroClipboard
and set the path to its.swf
file, before using this mixin.