react-clipboard-component
v1.0.8
Published
React Clipboard Component
Downloads
13
Readme
react-clipboard-component
Copy to clipboard React component using clipboard.js
Installation
npm install --save react-clipboard-component
Usage
import React from, {Component} 'react'
import Clipboard from 'react-clipboard-component'
export default class App extends Component {
render () {
return (
<Clipboard clipboard-text="Lorem ipsum dolor sit amet.">
<button>copy</button>
</Clipboard>
)
}
}
Options
text
: React.PropTypes.string.isRequired
Text to be copied to clipboard
onSuccess
: React.PropTypes.func
onError
: React.PropTypes.func
License
MIT