Skip to content

Hongchae/react-copyable

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#react-copyable Clipboard copyable React component

Implementation of clipboard copyable text React component.

usage

var React = require('react'),
Copyable = require('react-copyable');
...
  render: function() {
    return (
        <Copyable text="copy-text" />
    );
  }

...

The clipboard accessing is depend on document.execCommand function. If browser is not support the feature, only the text value is selected and can be copy using native operation(ex. press Ctrl + C ...).

Customization

There are two props to customize component:

  • Provides onCopy handler for when successfully copy to clipboard
  • The component have styles defined inline. Override styles via the style prop

About

Clipboard copyable React component

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published