node package manager



NumberInputField React component

Continuous Integration Coverage Status Downloads Version License


$ npm init
$ npm install @mitchallen/react-number-input-field --save


1: Add this line near the top of your file (like src/App.js):

import NumberInputField from '@mitchallen/react-number-input-field';

NOTE: NumberInputField must be Capitalized or component won't render.

2: Somewhere in the middle of the render method add this line:

<NumberInputField />

Simple Test

$ create-react-app react-number-input-field-test
$ cd react-number-input-field-test/
$ npm install @mitchallen/react-number-input-field --save
$ npm install --save material-ui

Modify src/App.js

import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';

// Must include MuiThemeProvider!
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
import NumberInputField from '@mitchallen/react-number-input-field';

class App extends Component {
  render() {
    return (
        <div className="App">
          <div className="App-header">
            <img src={logo} className="App-logo" alt="logo" />
            <h2>Welcome to React</h2>
          <p className="App-intro">
            To get started, edit <code>src/App.js</code> and save to reload.
          <NumberInputField />

export default App;

Run the app

npm start


Run the Tests

To test, go to the root folder and type (sans $):

$ npm test



In lieu of a formal style guide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.

Version History

Version 0.1.5

  • Changed inputmode to inputMode

Version 0.1.4

  • Added - run: yarn add react to .circleci/config.yml

Version 0.1.3

  • react is now only a peer dependency
  • cleaned up dupe dependencies
  • installed eslint as dev dependency

Version 0.1.2

  • added examples folder and example

Version 0.1.1

  • updated test case

Version 0.1.0

  • initial release