email-input

3.0.0 • Public • Published

email-input Build Status

Email input component for virtual-dom

Install

$ npm install --save email-input

Usage

var EmailInput = require('email-input')
var emailInput = EmailInput()
 
function render (state) {
  var vtree = EmailInput.render(state)
  //=> use virtual-dom to patch vtree into real DOM
}
 
emailInput(render)

API

EmailInput(data) -> function

Create a new email input observable.

data

Type: object

The initial state of the input.

value

Type: string

The email address.

EmailInput.validate(state) -> boolean

Validate the email input state.

EmailInput.render(state, options) -> object

Render an email state to a vtree object. options will be merged with the defaults ({type: 'email', name: 'email'}) and passed to virtual-hyperscript.

License

MIT © Ben Drucker

Package Sidebar

Install

npm i email-input

Weekly Downloads

5

Version

3.0.0

License

MIT

Last publish

Collaborators

  • bendrucker