@maskin/react
v0.2.0
Published
Easy to use masking for React
Downloads
1
Readme
Maskin react
Maskin module for working with React applications. It provides useful stuff like masking components for you to use within your React projects.
Installing
npm i -S @maskin/react
#or
yarn add @maskin/react
The Mask
component
The Mask
component is a higher-order component that uses the children render
pattern
to keep logic into the component but it delegates the responsibility of
rendering to the children.
Example:
import { Mask } from "@maskin/react";
<Mask pattern="###-xxx">
{({ value, handleChange }) => (
<input type="text" value={value} onChange={handleChange} />
)}
</Mask>
The Input
component
The Input
component is a useful component for quick usage of masking.
Example:
import { Input } from "@maskin/react";
<Input mask="xxx.xxx-##" />