npm.io
0.2.0 • Published 7 years ago

@maskin/react

Licence
MIT
Version
0.2.0
Deps
1
Size
61 kB
Vulns
0
Weekly
0

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-##" />

License

MIT License

Keywords