UNPKG

react-clipboard-simple

Version:

Component that allows user to copy text on simple click.

47 lines (34 loc) 939 B
# react-clipboard-simple Component that allows user to copy text on simple click. ## [](https://www.npmjs.com/package/react-clipboard-simple#install)Install npm install react-clipboard-simple --save #or... yarn add react-clipboard-simple ## [](https://www.npmjs.com/package/react-clipboard-simple#usage)Usage ```js import React from "react"; import ReactClipboard from "react-clipboard-simple"; export default function App() { let data = [ { title: "Joy", symbol: "😂", keywords:"face with tears of joy happy silly smiley cry laugh laugh emotion emotion sarcastic sarcastic" },{ title: "Smiley", symbol: "😃", keywords:"smiling face with open mouth happy smiley emotion emotion good good", }]; return ( <div> {data.map((emoji) => { return ( <ReactClipboard keyword={emoji.keywords}> <h1>{emoji.symbol}</h1> </ReactClipboard> ); })} </div> ); } ```