1.0.4 • Published 9 years ago
react-number-field v1.0.4
react-number-field
Install
$ npm i --save react-number-fieldUsage
import NumberField from 'react-number-field'
let value = 3
<NumberField value={value} onChange={onChange} />
<NumberField defaultValue={value}/>Props
allowFloat: Boolean- defaults to true. Specifyfalseto only allow integersallowNegative: Boolean- defaults to trueminValuemaxValuestep: Number- defaults to 1shiftStep: Number- defaults to 10stepDelay: Number- defaults to 40 msstepOnWheel: Boolean- defaults to truerequireFocusOnStep: Boolean- defaults to truenumbersOnly: Boolean- defaults to truefactory: Function- another React factory to render a different component. By default, areact-fieldis rendered.onChange(value, event)- By default, theonChangehandler will be called with the value as the first arg. If you use afactoryfunction that callsonChangewith other args, those will be passed to theonChange.validate(newValue, char, props)
Development
$ npm run dev