React Brazil contains formatting, validators and mask for brazillian like apps
See the LIVE DEMO !
Modules:
- CPF
- CNPJ
- RG
- Inscrição Estadual
- Telefone e Celular
- CEP
- Currency (Dinheiro)
- Time (horas e minutos)
- Number (numero e ponto decimal)
- Placa de Carro
- Renavam
- Título de Eleitor
- Proceso Jurídico
npm install --save react-brazil
import * as React from 'react'
import {BrazilFormatComponent , BrazilMaskComponent} from 'react-brazil'
class Example extends React.Component {
constructor(props){
super(props);
this.value = '12345678900';
this.format = 'cpf';
}
render () {
return (
<div>
<BrazilFormatComponent value={this.value} format={this.format}/>
<BrazilMaskComponent value={this.value} format={this.format}/>
<BrazilFormatComponent value="12345678900" format="cpf"/>
<BrazilMaskComponent value="12345678900" format="cpf"/>
</div>
)
}
}
Demo component files are included in Git Project.
Demo Project: [https://github.com/mariohmol/react-brazil/blob/master/example/)
Used as reference the pipes/validators from:
- https://github.com/mariohmol/js-brasil
- https://github.com/text-mask/text-mask/tree/master/react#readme
Fork this project and following the instructions below:
npm install
cd example
npm install
to run the demo:
npm start
in the root foldernpm start
in theexample
folder the site will be at: localhost:3000
Create the validate component
<BrazilValidateComponent />
MIT © mariohmol