Copy text to the system clipboard by clicking on it 📝
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib
.babelrc
.editorconfig
.eslintrc.json
.gitignore
.npmignore
README.md
jestSetup.js
package.json
rollup.config.js
yarn.lock

README.md

react-clickcopy

Copy a piece of text by clicking on it.

Install

npm install --save react-clickcopy
yarn add react-clickcopy

Usage

export default () => (
  <h3><ClickCopy>http://localhost:8080</CopyClick><h3>
);

The component itself does not validate its children. The text extrapolation is handled natively by the browser through Range.selectNodeContents and Document.execCommand('copy').