0.9.0 • Published 4 years ago

vue-number-stepper v0.9.0

Weekly downloads
6
License
-
Repository
-
Last release
4 years ago

Vue Number Stepper

Build Status Coverage Status

Feature complete iOS-style stepper control for Vue.js

Live demo

Features

  • Inspired by Apple's redesigned UIStepper from iOS 13.
  • Works with v-model
  • Configurable minimum & maximum values
  • Works with custom step values (skip by 10, etc.)
  • Long press to rapidly tap through values
  • Rigorously tested with 100% branch coverage
  • Fully accessible and compatible with screen readers

UX tip: Steppers are best for selecting Poisson numbers - small amounts with low variability, such as 0-10. Check out this article for more details

Installation

npm i vue-number-stepper

Usage

<VueNumberStepper 
  v-model="mainDemoStepperValue" 
  :maxValue="42" 
  :minValue="0" 
  :stepSize="1" 
  :isDisabled="false" 
  :holdToAutoTap="true" 
  :autoTapRepeatIncrementMilliseconds="100"/>

Props

All props besides value are optional

PropsTypeNotes
valueNumberThe current value of the stepper. v-model takes care of this for you.
maxValueNumberMust be greater than minValue. Must be divisible by stepSize
minValueNumberdefault is 0
stepSizeNumberMust be greater than 0.
isDisabledBooleanUse this to disable the control entirely
holdToAutoTapBooleantrue by default. Use this to disable hold-to-tap
autoTapRepeatIncrementMillisecondsNumber100 by default. Controls the amount of milliseconds between incerement/decrement events when the button is held down.