vaffel / react-components

Searchable repository of React-components
http://react-components.com/
MIT License
164 stars 22 forks source link

Click-To-Copy NPM Install Links #6

Open brigand opened 10 years ago

brigand commented 10 years ago

You could add a copy button for the npm command using react-zeroclipboard. Not sure exactly what it should say.

var ReactZero = require('react-zeroclipboard');
// ...
var command = "npm install --save " + packageName;
<ReactZero text={command}>
  <button>copy "{command}"</button>
</ReactZero>
TheLudd commented 9 years ago

The copied command would need to be different depending on if it is a production component, dev component or global component. The fact that all components need to be tagged with react-component suggests that they are for production use, but still....