1.1.2 • Published 3 years ago
web-copy-to-clipboard v1.1.2
web-copy-to-clipboard 📋
This is a simple module that helps you to easily implement a functionality to copy text to clipboard.
Installation
Run:
npm install web-copy-to-clipboard
or
yarn add web-copy-to-clipboard
Usage
All you need to do is to import the module, and then call it's function anywhere you want to trigger it.
React.js example:
import React from 'react';
import copyToClipboard from 'web-copy-to-clipboard';
export default function App() {
return (
<button
// calling the function when clicking a button
onClick={() => copyToClipboard("I'll be copied!")}
>
'Copy text'
</button>
)
}