tl-react-numeric-input
Version:
React component as a numeric input field
69 lines (46 loc) • 2.26 kB
Markdown
[](https://www.npmjs.com/package/tl-react-numeric-input)
# TLNumericInput
> React component as a numeric input field
[](https://snyk.io//test/github/MitrophD/tl-react-numeric-input?targetFile=package.json)  [](https://codeclimate.com/github/MitrophD/tl-react-numeric-input/maintainability) [](https://badge.fury.io/js/tl-react-numeric-input) [](https://github.com/MitrophD/tl-react-numeric-input)   
[](https://www.npmjs.com/package/tl-react-numeric-input)
## Installation
Use the package manager to install tl-react-numeric-input:
```shell
yarn add tl-react-numeric-input
# or
npm i tl-react-numeric-input
```
## Demo
Download and unzip archive or clone with command:
```shell
git clone https://github.com/MitrofD/tl-react-numeric-input.git
```
Then install dependencies:
```shell
yarn install
# or
npm install
```
Last step run **start** command:
```shell
yarn run start
# or
npm run start
```
## Usage
```js
import TLNumericInput from 'tl-react-numeric-input';
<TLNumericInput onSet={handleOnSet} />
```
Your handler for the onSet event should expect a TLNumericInput. For example:
```js
function handleOnSet(numericInput) {
this.setState({
numeric: numericInput.value
});
}
```
## Attributes
All attributes for input with number type + optional **onSet** handler
## License
[MIT](https://choosealicense.com/licenses/mit/)