Skip to content

bendrucker/copy-input

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

copy-input Build Status

Render an input that auto-selects and copies when clicked

Install

$ npm install --save copy-input

Usage

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

API

CopyInput() -> function

Returns an observable value representation (state).

CopyInput.render(state, options) -> object

Renders the copy input to a vtree. options.value is displayed in the input field.

License

MIT © Ben Drucker

About

Render an input that auto-selects and copies when clicked

Resources

License

Stars

Watchers

Forks

Packages

No packages published