Input Number with React

Input Number with React

rc-input-number Input number control.


Input number control.





import InputNumber from 'rc-input-number';

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


npm install
npm start


online example:



name type default description
prefixCls string rc-input-number Specifies the class prefix
min Number Specifies the minimum value
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
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
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

Keyboard Navigation

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

Test Case

npm test
npm run chrome-test


npm run coverage

open coverage/ dir

Download Details:

Author: react-component


Source Code:

react react-native mobile-apps

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

How native is React Native? | React Native vs Native App Development

Article covers: How native is react native?, React Native vs (Ionic, Cordova), Similarities and difference between React Native and Native App Development.

React Native Mobile App Development

Skenix is providing React Native Development Services with qualified React Native App Developers. Get the best React Native App Development Services.

How React Native Is Shaping Mobile App Development

Are you a mobile app developer looking for more efficient tools for your projects? Mobile app development is getting tougher and tougher as the market continues to grow. As a developer, you need to develop Apps which meet the demands of your users. To achieve this, adopt the right tools, like the React Native development framework.

Top React Native Mobile App Development Companies in USA

Looking for top React Native mobile app development company in USA for Startups & Enterprise? Find out the top list of React Native mobile app development company in USA.

Which is the best React Native app development company in New York?

Hire top react native app development company in New York to build and develop custom react native mobile apps for Android & iOS with the latest features.