1.1.5 • Published 3 years ago

use-copy-clipboard-hook v1.1.5

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

Copy Clipboard Custom Hook 🪝

The easiest way to use copy to clipboard in React as a custom hook 🪝

Installation

npm i use-copy-clipboard-hook

Usage

import { useCopyToClipboard } from "use-copy-clipboard-hook";

function App() {
  const [copied, copyToClipboard] = useCopyToClipboard();
  return (
    <div className="App">
      <button onClick={() =>
        copyToClipboard('Copy Text', 3000)}>Copy</button>
      {copied ? "Text copied 🥳🥳" : "Copy 🤖"}
    </div>
  );
}

export default App;

Authors

🔗 Links

linkedin twitter

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago