use-input-phone-mask
v0.0.6
Published
## Installation
Downloads
111
Maintainers
Readme
useInputPhoneMask
Installation
Yarn
yarn add use-input-phone-mask
NPM
npm install use-input-phone-mask
Then, require it and use it.
import React from 'react'
import { useInputPhoneMask } from 'use-input-phone-mask';
export default () => {
const { ref: inputRef, onChange } = useInputPhoneMask({ mask: '+# (###)###-####' });
return (
<div>
<input ref={inputRef} onChange={onChange} />
</div>
)
}
Example
To see an example of the code running, follow these steps:
- Clone the repo,
git clone https://github.com/awen2841/use-input-phone-mask.git
cd use-input-phone-mask/exemple
npm install
npm run storybook
- Open http://localhost:6001
The code of the example is in exemple
.