1.0.9 • Published 3 years ago

react-easy-mask v1.0.9

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

react-easy-mask

A simple masked input to React

NPM

Install

npm install --save react-easy-mask
or
yarn add react-easy-mask

Usage

import React from 'react';
import { MaskedNumber } from 'react-easy-mask'

const App = () => {
  return (
    <MaskedNumber mask="###.##.#" onChangeValue={console.log} />
  );
};

export default App;

Components

MaskedNumber

  • Props | Name | Type | Description | Example | Return | |:---------------|:---------------|:--------------:|--------:| ---------------:| | mask |string | a mask pattern | ###.##.#| - | | onChangeValue |function | change event | |unmasked value | | ref |IMaskedNumberRef| input ref | | - |
  • Ref | Name | Type | Description | Return | |:---------------|:----------------|:-------------------------| -------:| | getValue |function | gets input value |string | | setValue |function | sets input value | - | | focus |function |sets focus on the input | - | | blur |function |removes focus on the input| - |

MaskedCurrency

  • Props

    NameTypeDescriptionExampleReturn
    localestringBCP 47 tagpt-BR-
    currencystringSO 4217 codeBRL-
    onChangeValuefunctionchange eventnumber
    maxnumbermax value-
    refIMaskedCurrencyRefinput ref-
  • Ref | Name | Type | Description | Return | |:---------------|:----------------|:-------------------------| -------:| | getValue |function | gets input value |number | | setValue |function | sets input value | - | | focus |function |sets focus on the input | - | | blur |function |removes focus on the input| - |

License

MIT © Aldriê Mizobuti

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago