1.0.4 • Published 7 years ago

react-mask-essentials v1.0.4

Weekly downloads
-
License
MIT
Repository
-
Last release
7 years ago

react-mask-essentials

A many purpose input mask toolkit, currently includes number masks, character masks, date masks and credit to jsillitoe and contributors for the currency masks.

Installation

npm install react-mask-essentials --save

Integration

You can create a mask like the following, it can accept all of the properties that an input element can accept

import {NumberMask} from 'react-mask-essentials';
import {CharMask} from 'react-mask-essentials';
import {IsoDateMask} from 'react-mask-essentials';
import {CurrencyMask} from 'react-mask-essentials'

const App = () => (
  <div>
    <NumberMask placeholder="0" type="integer" />
    <CharMask className="foo" mode="alphabet" />
    <IsoDateMask id="bar" separator="-" />
    <CurrencyMask prefix="£" />
  </div>
);

export default App;

Options

OptionDefault ValueDescription
typeintegerFor NumberMasks, accepts "integer" and "float"
modealphabetFor CharMasks, accepts "alphabet", "special", "both" and "email"
separator/For IsoDateMasks, accepts any character as a separator for the YYYY MM and DD values

For more on currency masks see jsillitoe's library here Feel free to contribute and add new features or improve current ones, thanks!

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago