1.1.6 • Published 2 years ago
mask-input-dynamic v1.1.6
mask-input-dynamic
Create your own mask simple and fast! Use styles pre-defined and more.
Installing
npm install mask-input-dynamic
yarn add mask-input-dynamic
Usage
import { mask } from "mask-input-dynamic";
function InputFone(props) {
const [fone, setFone] = useState('')
return (
<input type="text" onChange={(e) => setFone(mask(e.currentTarget.value, {style:'fone'}))} value={fone} />
)
}
Properties
Name | Type | Description |
---|---|---|
value | {String} | Value for mask |
pattern | {String} | Enter with your mask with # pattern |
style | {fone/cpf} | Chose one style pre-defined for your mask |