Socket
Socket
Sign inDemoInstall

use-clipboard-hook

Package Overview
Dependencies
1
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    use-clipboard-hook

Copy to clipboard React hook.


Version published
Weekly downloads
371
decreased by-22.55%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

use-clipboard

Copy to clipboard React hook.

NPM JavaScript Style Guide

Install

npm install --save use-clipboard

Usage

import * as React from "react";

import { useClipboard } from "use-clipboard";

const Example = () => {
  const [inputRef, onClick] = useClipboard({
    onCopy: (text) => console.log(`Copied: ${text}`),
  });
  return (
    <div>
      <input ref={inputRef} defaultValue="Change this..." />
      <button onClick={onClick}>copy</button>
    </div>
  );
};

Live Demo

License

MIT © fayeed


This hook is created using create-react-hook.

FAQs

Last updated on 13 Jul 2020

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc