1.0.0 • Published 7 years ago
clipd v1.0.0
About
A puny 721 byte(gzipped & minified) copy to clipboard library. For modern browsers.
Install
With cdn:
<script src="https://unpkg.com/clipd/lib/clipd.min.js"></script>
<!-- Or -->
<script src="https://rawgit.com/tiaanduplessis/clipd/master/lib/clipd.min.js"></script>
With Bower:
$ bower install clipd
With npm:
$ npm install --save clipd
With yarn:
$ yarn add clipd
Usage
// Works with a string selector or element node
clipd('.selector')
// OR
const elem = document.getElementById('elem')
clipd(elem)
API
The module exports a single function with signature:
clipd(selector|elementNode, options)
Current available options:
{
event: 'click', // Event to trigger copy on. Default 'click
callback: (result) => {} // callback with the result of copy(boolean)
}
Example
Check out the example directory.
Contribute
Contributions are welcome. Please open up an issue or create PR if you would like to help out.
Note: If editing the README, please conform to the standard-readme specification.
License
Licensed under the MIT License.
1.0.0
7 years ago