An input masking package for React developers is a tool or library that helps control and format user input in input fields. It's particularly useful when you want to enforce a specific pattern or structure for the data being entered, such as phone numbers, dates, credit card numbers, or other custom formats.
Use the package manager pnpm / yarn / npm to install foobar.
pnpm install react-all-mask
import * as React from 'react'
import { useReactAllMask, Mask } from 'react-all-mask'
export default function App() {
const [ref] = useReactAllMask<HTMLInputElement>({ mask: Mask.number })
return (
<div>
<input placeholder="Type..." id="inputEl" ref={ref} />
</div>
)
}
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
$ pnpm dev