1.0.4 • Published 3 years ago

react-input-masked v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

react-input-masked

The react-input-mask is a react component that returns an input-mask with the sanitized value and formatted for use

Getting Started

  1. First. You need to install it, just like. You would do with most any NPM packages:
npm i --save react-input-masked

Or with yarn:

yarn add react-input-masked
  1. Then, you need to import the library component within your own component
import React from 'react'
import MaskedInput from 'react-input-masked'
  1. You can now start using the component
import React, { useState } from 'react'
import MaskedInput from 'react-input-masked'

const AnyComponent = () => {
    const [cpf, setCpf] = useState('')

    return <MaskedInput type="cpf" onChange={event => setCpf(event.target.value)} />
}

The "type" property of the component in version 1.0.4 can receive the following values:

cpf, cnpj, cep, phone

New masks will be added in future versions.

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago