Quantity Stepper

A quantity input with rolling digits, hold-to-repeat buttons, and boundary shake.

@spectrumui/quantity-stepper

Aurora Headphones

$129.00
1

Tap or hold the buttons — digits roll, the price follows, boundaries shake

Installation

Login to view commandCreate a free account to access the install command

Usage

import { QuantityStepper } from "@/components/spectrumui/quantity-stepper"
<QuantityStepper min={1} max={10} onValueChange={(value) => console.log(value)} />

API Reference

QuantityStepper

Renders a group containing a keyboard operable spinbutton value between two step buttons. Pass value to control it from outside, or defaultValue to let it manage its own state. The value is always clamped to min and max.

PropTypeDefaultDescription
valuenumber-Controlled value. Leave undefined for uncontrolled usage
defaultValuenumber1Initial value when uncontrolled
onValueChange(value: number) => void-Fires with the next clamped value on every change
minnumber0Lowest allowed value
maxnumber99Highest allowed value
stepnumber1Amount added or removed per press. PageUp and PageDown jump by ten steps
size"sm" | "md" | "lg""md"Visual size of the stepper
disabledbooleanfalseDisables pointer and keyboard interaction
classNamestring-Additional classes merged with the default pill styles

Examples

Sizes and limits

1
2
3
4

Max 5 per order