JSPM

stepper-input

1.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q26088F
  • License MIT

Simple numeric stepper UI component

Package Exports

  • stepper-input

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (stepper-input) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Stepper

A simple numeric stepper with no dependencies, written in pure js.

Installation

npm install --save-dev stepper-input

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' 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({
  stepper: 'my-stepper-class',
  add: 'my-adder-class',
  subtract: 'my-subtract-class',
  field: 'my-field-class'
});

stepper: class for identifying steppers

add: class for identifying stepper adders

subtract: class for identifying stepper subtractors

field: class for identifying stepper fields