react-number-field
v1.0.4 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. Specifyfalse
to only allow integersallowNegative: Boolean
- defaults to trueminValue
maxValue
step: 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-field
is rendered.onChange(value, event)
- By default, theonChange
handler will be called with the value as the first arg. If you use afactory
function that callsonChange
with other args, those will be passed to theonChange
.validate(newValue, char, props)
Development
$ npm run dev