react-masked-text-input

0.0.2 • Public • Published

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"
/>

/react-masked-text-input/

    Package Sidebar

    Install

    npm i react-masked-text-input

    Weekly Downloads

    0

    Version

    0.0.2

    License

    CC0

    Last publish

    Collaborators

    • msafi