rc-input-number
React input-number component
Last updated 2 years ago by afc163 .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install rc-input-number 
SYNC missed versions from official npm registry.

rc-input-number

Input number control.

NPM version npm download build status Codecov bundle size dumi

Screenshots

Install

rc-input-number

Usage

import InputNumber from 'rc-input-number';

export default () => <InputNumber defaultValue={10} />;

Development

npm install
npm start

Example

http://127.0.0.1:8000/examples/

online example: https://input-number.vercel.app/

API

props

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
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
wheel Boolean true Allows changing value with mouse wheel

Keyboard Navigation

  • When you hit the <kbd>⬆</kbd> or <kbd>⬇</kbd> key, the input value will be increased or decreased by step
  • With the <kbd>Shift</kbd> key (<kbd>Shift+⬆</kbd>, <kbd>Shift+⬇</kbd>), the input value will be changed by 10 * step
  • With the <kbd>Ctrl</kbd> or <kbd>⌘</kbd> key (<kbd>Ctrl+⬆</kbd> or <kbd>⌘+⬆</kbd> or <kbd>Ctrl+⬇</kbd> or <kbd>⌘+⬇</kbd> ), the input value will be changed by 0.1 * step

Mouse Wheel

  • When you scroll up or down, the input value will be increased or decreased by step
  • Scrolling with the <kbd>Shift</kbd> key, the input value will be changed by 10 * step

Test Case

npm test
npm run chrome-test

Coverage

npm run coverage

open coverage/ dir

License

rc-input-number is released under the MIT license.

Current Tags

  • 4.0.0-alpha.1                                ...           beta (7 years ago)
  • 9.3.0                                ...           latest (2 months ago)

218 Versions

  • 9.3.0                                ...           2 months ago
  • 9.2.0                                ...           5 months ago
  • 9.1.0                                ...           7 months ago
  • 9.0.0                                ...           a year ago
  • 8.6.1                                ...           a year ago
  • 8.6.0                                ...           a year ago
  • 8.5.0                                ...           a year ago
  • 8.4.0                                ...           a year ago
  • 8.3.0                                ...           a year ago
  • 8.2.0                                ...           a year ago
  • 8.1.0                                ...           a year ago
  • 8.0.4                                ...           a year ago
  • 8.0.3                                ...           a year ago
  • 8.0.2                                ...           a year ago
  • 8.0.1                                ...           a year ago
  • 8.0.0                                ...           2 years ago
  • 8.0.0-alpha.1                                ...           2 years ago
  • 8.0.0-alpha.0                                ...           2 years ago
  • 7.4.2                                ...           2 years ago
  • 7.4.1                                ...           2 years ago
  • 7.4.0                                ...           2 years ago
  • 7.3.11                                ...           2 years ago
  • 7.3.9                                ...           2 years ago
  • 7.3.8                                ...           2 years ago
  • 7.3.7                                ...           2 years ago
  • 7.3.6                                ...           2 years ago
  • 7.3.5                                ...           2 years ago
  • 7.3.4                                ...           3 years ago
  • 7.3.3                                ...           3 years ago
  • 7.3.2                                ...           3 years ago
  • 7.3.1                                ...           3 years ago
  • 7.3.0                                ...           3 years ago
  • 7.2.0                                ...           4 years ago
  • 7.1.4                                ...           4 years ago
  • 7.1.3                                ...           4 years ago
  • 7.1.2                                ...           4 years ago
  • 7.1.1                                ...           4 years ago
  • 7.1.0                                ...           4 years ago
  • 7.0.6                                ...           4 years ago
  • 7.0.5                                ...           4 years ago
  • 7.0.4                                ...           4 years ago
  • 7.0.3                                ...           4 years ago
  • 4.5.9                                ...           4 years ago
  • 4.5.8 [deprecated]           ...           4 years ago
  • 4.5.8-beta.2                                ...           4 years ago
  • 4.5.8-beta.1                                ...           4 years ago
  • 4.5.8-beta.0                                ...           4 years ago
  • 7.0.2                                ...           4 years ago
  • 7.0.1                                ...           4 years ago
  • 7.0.0                                ...           4 years ago
  • 7.0.0-alpha.4                                ...           4 years ago
  • 7.0.0-alpha.3                                ...           4 years ago
  • 7.0.0-alpha.2                                ...           4 years ago
  • 7.0.0-alpha.1                                ...           4 years ago
  • 7.0.0-alpha.0                                ...           4 years ago
  • 6.2.0                                ...           4 years ago
  • 6.1.3                                ...           4 years ago
  • 6.1.2                                ...           4 years ago
  • 6.1.1                                ...           4 years ago
  • 6.1.0                                ...           4 years ago
  • 6.0.1                                ...           4 years ago
  • 6.0.0                                ...           4 years ago
  • 5.1.1                                ...           4 years ago
  • 5.1.0                                ...           4 years ago
  • 5.0.1                                ...           5 years ago
  • 5.0.0                                ...           5 years ago
  • 4.6.3                                ...           5 years ago
  • 4.6.2                                ...           5 years ago
  • 4.6.1                                ...           5 years ago
  • 4.6.0                                ...           5 years ago
  • 4.5.7                                ...           5 years ago
  • 4.5.6                                ...           5 years ago
  • 4.5.5                                ...           5 years ago
  • 4.5.4                                ...           5 years ago
  • 4.5.3                                ...           5 years ago
  • 4.5.2                                ...           5 years ago
  • 4.5.1                                ...           5 years ago
  • 4.5.0                                ...           5 years ago
  • 4.4.5                                ...           6 years ago
  • 4.4.4                                ...           6 years ago
  • 4.4.3                                ...           6 years ago
  • 4.4.2                                ...           6 years ago
  • 4.4.1                                ...           6 years ago
  • 4.4.0                                ...           6 years ago
  • 4.3.9                                ...           6 years ago
  • 4.3.8                                ...           6 years ago
  • 4.3.7                                ...           6 years ago
  • 4.3.6                                ...           6 years ago
  • 4.3.5                                ...           6 years ago
  • 4.3.4                                ...           6 years ago
  • 4.3.3                                ...           6 years ago
  • 4.3.2                                ...           6 years ago
  • 4.3.1                                ...           6 years ago
  • 4.3.0                                ...           6 years ago
  • 4.2.0                                ...           6 years ago
  • 4.1.0                                ...           6 years ago
  • 4.0.13                                ...           6 years ago
  • 4.0.12                                ...           6 years ago
  • 4.0.11                                ...           6 years ago
  • 4.0.10                                ...           7 years ago
  • 4.0.9                                ...           7 years ago
  • 4.0.8                                ...           7 years ago
  • 4.0.7                                ...           7 years ago
  • 4.0.6                                ...           7 years ago
  • 4.0.5                                ...           7 years ago
  • 4.0.4                                ...           7 years ago
  • 4.0.3                                ...           7 years ago
  • 4.0.2                                ...           7 years ago
  • 4.0.1                                ...           7 years ago
  • 3.6.10                                ...           7 years ago
  • 4.0.0                                ...           7 years ago
  • 3.6.9                                ...           7 years ago
  • 3.6.8                                ...           7 years ago
  • 3.7.0                                ...           7 years ago
  • 4.0.0-alpha.1                                ...           7 years ago
  • 4.0.0-alpha.0                                ...           7 years ago
  • 3.6.7                                ...           7 years ago
  • 3.6.6                                ...           7 years ago
  • 3.6.5                                ...           7 years ago
  • 3.6.4                                ...           7 years ago
  • 3.6.3                                ...           7 years ago
  • 3.6.2                                ...           7 years ago
  • 3.6.1                                ...           7 years ago
  • 3.6.0                                ...           8 years ago
  • 3.5.0                                ...           8 years ago
  • 3.4.15                                ...           8 years ago
  • 3.4.14                                ...           8 years ago
  • 3.4.13                                ...           8 years ago
  • 3.4.12                                ...           8 years ago
  • 3.4.11                                ...           8 years ago
  • 3.4.10                                ...           8 years ago
  • 3.4.9                                ...           8 years ago
  • 3.4.8                                ...           8 years ago
  • 3.4.7                                ...           8 years ago
  • 3.3.5                                ...           8 years ago
  • 3.4.6                                ...           8 years ago
  • 3.3.4                                ...           8 years ago
  • 3.4.5                                ...           8 years ago
  • 3.3.3                                ...           8 years ago
  • 3.4.4                                ...           8 years ago
  • 3.4.3                                ...           8 years ago
  • 3.3.2                                ...           8 years ago
  • 3.4.2                                ...           8 years ago
  • 3.4.1                                ...           8 years ago
  • 3.3.1                                ...           8 years ago
  • 3.4.0                                ...           8 years ago
  • 3.3.0                                ...           8 years ago
  • 3.2.1                                ...           8 years ago
  • 3.1.3                                ...           8 years ago
  • 3.2.0                                ...           8 years ago
  • 3.1.2                                ...           8 years ago
  • 3.1.1                                ...           8 years ago
  • 3.1.0                                ...           8 years ago
  • 3.0.4                                ...           8 years ago
  • 3.0.3                                ...           8 years ago
  • 3.0.2                                ...           8 years ago
  • 3.0.1                                ...           8 years ago
  • 3.0.0                                ...           8 years ago
  • 2.8.9                                ...           8 years ago
  • 2.8.8                                ...           8 years ago
  • 2.8.7                                ...           8 years ago
  • 2.8.6                                ...           8 years ago
  • 2.8.5                                ...           8 years ago
  • 2.8.4                                ...           8 years ago
  • 2.8.3                                ...           8 years ago
  • 2.8.2                                ...           8 years ago
  • 2.8.1                                ...           8 years ago
  • 2.8.0                                ...           8 years ago
  • 2.7.8                                ...           8 years ago
  • 2.7.7                                ...           8 years ago
  • 2.7.6                                ...           8 years ago
  • 2.7.5                                ...           8 years ago
  • 2.7.4                                ...           8 years ago
  • 2.7.3                                ...           8 years ago
  • 2.7.2                                ...           8 years ago
  • 2.7.1                                ...           8 years ago
  • 2.7.0                                ...           8 years ago
  • 2.6.3                                ...           8 years ago
  • 2.6.2                                ...           8 years ago
  • 2.5.15                                ...           8 years ago
  • 2.6.1                                ...           8 years ago
  • 2.6.0                                ...           8 years ago
  • 2.5.14                                ...           8 years ago
  • 2.5.13                                ...           8 years ago
  • 2.5.12                                ...           8 years ago
  • 2.5.11                                ...           9 years ago
  • 2.5.10                                ...           9 years ago
  • 2.5.9                                ...           9 years ago
  • 2.5.8                                ...           9 years ago
  • 2.5.7                                ...           9 years ago
  • 2.5.6                                ...           9 years ago
  • 2.5.5                                ...           9 years ago
  • 2.5.4                                ...           9 years ago
  • 2.5.3                                ...           9 years ago
  • 2.5.2                                ...           9 years ago
  • 2.5.1                                ...           9 years ago
  • 2.5.0                                ...           9 years ago
  • 2.4.7                                ...           9 years ago
  • 2.4.6                                ...           9 years ago
  • 2.4.5                                ...           9 years ago
  • 2.4.4                                ...           9 years ago
  • 2.4.3                                ...           9 years ago
  • 2.4.2                                ...           9 years ago
  • 2.4.1                                ...           9 years ago
  • 2.4.0                                ...           9 years ago
  • 2.3.0                                ...           9 years ago
  • 2.2.0                                ...           9 years ago
  • 2.1.2                                ...           9 years ago
  • 2.1.1                                ...           9 years ago
  • 2.1.0                                ...           9 years ago
  • 2.0.4                                ...           9 years ago
  • 2.0.3                                ...           9 years ago
  • 2.0.2                                ...           9 years ago
  • 2.0.1                                ...           9 years ago
  • 2.0.0                                ...           9 years ago
  • 1.0.2                                ...           10 years ago
  • 1.0.1                                ...           10 years ago
  • 1.0.0                                ...           10 years ago
Downloads
Total 6
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 1
Last Month 0
Dependencies (3)
Dev Dependencies (23)
Dependents (3)

© 2010 - cnpmjs.org x YWFE | Home | YWFE