1.4.6 • Published 5 years ago

react-number-textfield v1.4.6

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

ReactJS Number Textfield

ReactJS component for accepting numerical input as a standard textfield

Quickstart

Installation

npm install --save-dev react-number-textfield

Import

import { NumberTextfield } from "react-number-textfield"

Usage

<NumberTextfield
  decimal_character="."
  group_separator=","
  precision={ 2 }
  placeholder="Enter a number..."
  didChangeNumber={(newNumber) => {
    console.log("New Number", newNumber);
  }}
/>

Props

className string

CSS classes to apply to the input element.

placeholder string

Standard HTML placeholder attribute. This is the string displayed in the textfield when it is empty.

decimal_character string

Which character(s) should be used for the decimal point. Most commonly, this will be a comma or a dot.

group_separator string

Which character(s) should be used for grouping numbers every 3 digits. Most commonly, this will be a comma or a space.

precision number

Set the maximum number of decimal digits. Use 0 to disable decimals.

didChangeNumber function

Callback function that is executed every time the number value from the textfield changes. The function receives one argument: the number value from the textfield, or undefined if no number can be derived.

1.4.6

5 years ago

1.4.5

5 years ago

1.4.4

5 years ago

1.4.2

5 years ago

1.4.1

5 years ago

1.4.0

5 years ago

1.3.4

6 years ago

1.3.3

6 years ago

1.3.2

6 years ago

1.3.1

6 years ago

1.3.0

6 years ago

1.2.3

6 years ago

1.2.2

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago