Render an input that auto-selects and copies when clicked
$ npm install --save copy-input
var CopyInput = require('copy-input')
var state = CopyInput()
var options = {
style: {
background: 'blue'
},
value: 'copy me!'
}
CopyInput.render(state, options)
//=> ...
//=> renders blue readonly input that copies itself when clicked
Returns an observable value representation (state
).
Renders the copy input to a vtree. options.value
is displayed in the input field.
MIT © Ben Drucker