use-clipboard-api
TypeScript icon, indicating that this package has built-in type declarations

0.3.4 • Public • Published

📋 use-clipboard-api

useClipboardApi() is a React Hook that consumes Web Clipboard API.

build version MIT License downloads


Table of Contents

Motivation

Usage

To start using the use-clipboard-api in your project, first install in your project:

yarn add use-clipboard-api or npm install use-clipboard-api

Copy to clipboard:
import useClipboardApi from 'use-clipboard-api';

function App() {
  const [value, copy] = useClipboardApi();

  return (
    <div>
      <button onClick={() => copy('Text to be copied.')}>Copy me!</button>
      <p>Copied value: {value}</p>
    </div>
  );
}

export default App;

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Bugs and Sugestions

Report bugs or do suggestions using the issues.

License

MIT License © helderburato

/use-clipboard-api/

    Package Sidebar

    Install

    npm i use-clipboard-api

    Weekly Downloads

    36

    Version

    0.3.4

    License

    MIT

    Unpacked Size

    64.5 kB

    Total Files

    43

    Last publish

    Collaborators

    • helderburato
    • helderberto