New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-zeroclipboard-mixin

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-zeroclipboard-mixin

React mixin for automatic binding of the ZeroClipboard client to the clipboard action DOM elements

  • 0.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

react-zeroclipboard-mixin

npm version Dependency Status Dev Dependency Status

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 = require('react');
var ZeroClipboardMixin = require('react-zeroclipboard-mixin');

// configure ZeroClipboard before using mixin
ZeroClipboardMixin.ZeroClipboard.config({
  swfPath: 'http://rawgit.com/zeroclipboard/zeroclipboard/master/dist/ZeroClipboard.swf'
});

var MyCopyButton = React.createClass({

  // CSS selector that would be used to find zeroclipboard action elements.
  // Default: '[data-zeroclipboard-copy-btn]'
  zeroclipboardElementsSelector: '[data-zeroclipboard-copy-btn]',

  mixins: [ ZeroClipboardMixin ],

  render: function() {
    return (
      <div>
        // Cannot be top-level element, so wrap it with div
        <button data-zeroclipboard-copy-btn data-clipboard-text="Text to copy">Copy</button>
      </div>
    );
  }

});

React.render(<MyCopyButton/>, document.body)

Notes

  • Doesn't support top-level elements as a clipboard control elements.
  • ZeroClipboard is available as a property of mixin ZeroClipboardMixin.ZeroClipboard.
  • You always have to configure ZeroClipboard and set the path to its .swf file, before using this mixin.

Keywords

FAQs

Package last updated on 27 Sep 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc