JSPM

stepper-input

1.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q26059F
  • 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 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'
  }
});