react-number-field

v1.0.2
React Number Field
number-field number field numeric field numeric input input react-component and 2 more...

react-number-field

Install

$ npm i --save react-number-field

Usage

import NumberField from 'react-number-field'

let value = 3


<NumberField value={value} onChange={onChange} />
<NumberField defaultValue={value}/>

Props

  • allowFloat: Boolean - defaults to true. Specify false to only allow integers
  • allowNegative: Boolean - defaults to true
  • minValue
  • maxValue
  • step: Number - defaults to 1
  • shiftStep: Number - defaults to 10
  • stepDelay: Number - defaults to 40 ms
  • stepOnWheel: Boolean - defaults to true
  • requireFocusOnStep: Boolean - defaults to true
  • numbersOnly: Boolean - defaults to true
  • factory: Function - another React factory to render a different component. By default, a react-field is rendered.
  • onChange(value, event) - By default, the onChange handler will be called with the value as the first arg. If you use a factory function that calls onChange with other args, those will be passed to the onChange.
  • validate(newValue, char, props)

Development

$ npm run dev

License

MIT

Metadata

  • MIT
  • Whatever
  • Radu Brehar
  • released 12/30/2015

Downloads