stepper-input
v1.1.0
Published
Simple numeric stepper UI component
Downloads
3
Maintainers
Readme
Stepper
A simple numeric stepper for the frontend with no dependencies.
Installation
npm install stepper-input --save
Usage
import stepper from 'stepper-input';
stepper.bindAll();
Add this "component"
<form class='stepper'>
<button class='subtract' type='button'>-</button>
<input class='field' type='number' value='0' min='0' max='10' />
<button class='add' type='button'>+</button>
</form>
Then you should style these classes and elements: stepper
, add
, subtract
, field
.
Options
import stepper from 'stepper-input';
stepper.bindAll({
classes: {
stepper: 'my-stepper-class', // default: 'stepepr'
add: 'my-adder-class', // default: 'add'
subtract: 'my-subtract-class', // default: 'subtract'
field: 'my-field-class' // default: 'field'
}
});