1.2.4 • Published 3 years ago

react-enhanced-numeric-input v1.2.4

Weekly downloads
5
License
MIT
Repository
github
Last release
3 years ago

Build Status

Netlify Status

react-enhanced-numeric-input

An enhanced Numeric Input made with React

Docs: https://react-enhanced-numeric-input.netlify.app/

Install

To install the component, just type:

npm install react-enhanced-numeric-input

or

yarn add react-enhanced-numeric-input

Using

To use it, you will need to import the component and use it like:

import NumericInput from "react-enhanced-numeric-input";
<NumericInput />

Example

<NumericInput decimalPrecision={2} value={50} />

Styles

The new version includes some default styles to format the money and percent input. To use it, it is necessary to import the styles in the project distribution pack.

Example

import "react-enhanced-numeric-input/dist/react-enhanced-numeric-input.css";

Properties

It is possible to set some properties globally.

Setting default properties

Some properties need to be set systemwide. To do so, it is necessary to import the function that defines it and set a new value.

Default values

PropertyDefault Value
moneyMask\$
percent%
decimalSeparator,
thousandSeparator

Example

import {
  setDefaultMoneyMask,
  setDefaultPercent,
  setDefaultDecimalSeparator,
  setDefaultThousandSeparator,
} from "react-enhanced-numeric-input";

setDefaultMoneyMask("US$");
setDefaultPercent("percent");
setDefaultDecimalSeparator(".");
setDefaultThousandSeparator(",");

Properties list

PropertyTypeDefault Value
classNamestring-
decimalPrecisionnumber0
disabledbooleanfalse
maxLengthnumber20
idstring-
namestring-
placeholderstring-
onChangefunction-
onBlurfunction-
onClickfunction-
onFocusfunction-
onKeyPressfunction-
stylestring-
valuestring or number-
percentbooleanfalse
moneybooleanfalse
stringValueOnBlurbooleanfalse
decimalSeparatorstring,
thousandSeparatorstring
moneyMaskstring\$
1.2.4

3 years ago

1.2.3

3 years ago

1.2.2

3 years ago

1.2.1

3 years ago

1.2.0

3 years ago

1.2.0-2

3 years ago

1.2.0-1

3 years ago

1.2.0-0

3 years ago

1.1.2

3 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.14

5 years ago

1.0.13

5 years ago

1.0.12

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.10-0

5 years ago

1.0.9

5 years ago

1.0.9-1

5 years ago

1.0.9-0

5 years ago

1.0.8

5 years ago

1.0.8-4

5 years ago

1.0.8-3

5 years ago

1.0.8-2

5 years ago

1.0.8-1

5 years ago

1.0.8-0

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago