stepper-input

1.1.0 • Public • Published

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'
  }
});

Package Sidebar

Install

npm i stepper-input

Weekly Downloads

9

Version

1.1.0

License

MIT

Last publish

Collaborators

  • jgod