# rc-input-number
Input number control.
[![NPM version][npm-image]][npm-url] [![dumi](https://img.shields.io/badge/docs%20by-dumi-blue?style=flat-square)](https://github.com/umijs/dumi) [![build status][github-actions-image]][github-actions-url] [![Test coverage][coveralls-image]][coveralls-url] [![Dependencies][david-image]][david-url] [![DevDependencies][david-dev-image]][david-dev-url] [![npm download][download-image]][download-url] [![bundle size][bundlephobia-image]][bundlephobia-url]
[npm-image]: http://img.shields.io/npm/v/rc-input-number.svg?style=flat-square
[npm-url]: http://npmjs.org/package/rc-input-number
[github-actions-image]: https://github.com/react-component/input-number/workflows/CI/badge.svg
[github-actions-url]: https://github.com/react-component/input-number/actions
[circleci-image]: https://img.shields.io/circleci/react-component/input-number/master?style=flat-square
[circleci-url]: https://circleci.com/gh/react-component/input-number
[coveralls-image]: https://img.shields.io/coveralls/react-component/input-number.svg?style=flat-square
[coveralls-url]: https://coveralls.io/r/react-component/input-number?branch=master
[david-url]: https://david-dm.org/react-component/input-number
[david-image]: https://david-dm.org/react-component/input-number/status.svg?style=flat-square
[david-dev-url]: https://david-dm.org/react-component/input-number?type=dev
[david-dev-image]: https://david-dm.org/react-component/input-number/dev-status.svg?style=flat-square
[download-image]: https://img.shields.io/npm/dm/rc-input-number.svg?style=flat-square
[download-url]: https://npmjs.org/package/rc-input-number
[bundlephobia-url]: https://bundlephobia.com/result?p=rc-input-number
[bundlephobia-image]: https://badgen.net/bundlephobia/minzip/rc-input-number
## Screenshots
## Install
[![rc-input-number](https://nodei.co/npm/rc-input-number.png)](https://npmjs.org/package/rc-input-number)
## Usage
```js
import InputNumber from 'rc-input-number';
export default () =>
name | type | default | description |
---|---|---|---|
prefixCls | string | rc-input-number | Specifies the class prefix |
min | Number | Specifies the minimum value | |
onClick | |||
placeholder | string | ||
max | Number | Specifies the maximum value | |
step | Number or String | 1 | Specifies the legal number intervals |
precision | Number | Specifies the precision length of value | |
disabled | Boolean | false | Specifies that an InputNumber should be disabled |
focusOnUpDown | Boolean | true | whether focus input when click up or down button |
required | Boolean | false | Specifies that an InputNumber is required |
autoFocus | Boolean | false | Specifies that an InputNumber should automatically get focus when the page loads |
readOnly | Boolean | false | Specifies that an InputNumber is read only |
controls | Boolean | true | Whether to enable the control buttons |
name | String | Specifies the name of an InputNumber | |
id | String | Specifies the id of an InputNumber | |
value | Number | Specifies the value of an InputNumber | |
defaultValue | Number | Specifies the defaultValue of an InputNumber | |
onChange | Function | Called when value of an InputNumber changed | |
onBlur | Function | Called when user leaves an input field | |
onPressEnter | Function | The callback function that is triggered when Enter key is pressed. | |
onFocus | Function | Called when an element gets focus | |
style | Object | root style. such as {width:100} | |
upHandler | React.Node | custom the up step element | |
downHandler | React.Node | custom the down step element | |
formatter | (value: number|string): displayValue: string | Specifies the format of the value presented | |
parser | (displayValue: string) => value: number | `input => input.replace(/[^\w\.-]*/g, '')` | Specifies the value extracted from formatter |
pattern | string | Specifies a regex pattern to be added to the input number element - useful for forcing iOS to open the number pad instead of the normal keyboard (supply a regex of "\d*" to do this) or form validation | |
decimalSeparator | string | Specifies the decimal separator | |
inputMode | string | Specifies the inputmode of input |