0.0.2 • Published 8 years ago

react-masked-text-input v0.0.2

Weekly downloads
1
License
CC0
Repository
-
Last release
8 years ago

Masked Text Input for React

This component let's you create a masked text input for React. See the demo here.

Getting started

First, install it.

npm i react-masked-text-input --save

Then, require it and use it.

var React = require('react')
var MaskedTextInput = require('react-masked-text-input')

var MyComponent = React.createClass({
  render() {
    return (
      <div>
        <MaskedTextInput pattern="(111) 111-1111" />
      </div>
    )
  }
})

Note that <MaskedTextInput/> is fully compatible with <input type="text"/> element. So, you can pass to it CSS classes, a placeholder attribute, or whatever.

For example, the following works:

<MaskedTextInput
  pattern="11111"
  className="form-control"
  placeholder="Enter zip code"
  id="my-input-id"
/>