Quantity Stepper

Overview

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

This form component is intended for interfaces that need a quantity input with rolling digits, hold-to-repeat buttons, and boundary shake, authentication flows, and settings forms. Its implementation is provided as editable source so the final behavior and styling stay inside your project.

Technologies

React
TypeScript
Tailwind CSS
Motion

Detected package dependencies: framer-motion, lucide-react.

@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

Use cases

  • interfaces that need a quantity input with rolling digits, hold-to-repeat buttons, and boundary shake
  • authentication flows
  • settings forms

Features

  • Copy-paste source that remains in your repository
  • TypeScript source included with the component
  • Tailwind CSS classes editable in the component source
  • Animation implemented with Motion
  • Responsive Tailwind variants present in the source
  • Reduced-motion handling present in the source

Accessibility

  • The source includes ARIA attributes or roles; preserve them when customizing the component.
  • The source includes keyboard event handling; verify it alongside pointer behavior.
  • The source checks reduced-motion preferences or includes motion-reduce styles.
  • Test focus order, keyboard operation, labels, contrast, and screen-reader output in the final application context.

Customization

  • Edit the Tailwind utility classes in the copied source to match your spacing, color, and typography tokens.
  • Use the documented className surface for local layout adjustments, then edit the source for structural changes.
  • Adjust Motion transitions in the source and keep the reduced-motion behavior aligned with the final interaction.

Topic guides

See how this component fits into broader interface patterns, implementation decisions, and working examples.

Quantity Stepper FAQ

Is Quantity Stepper free to use in commercial projects?

Yes. The public Quantity Stepper source is available under the Apache License 2.0, including for commercial use, subject to the LICENSE terms.

How do I install Quantity Stepper?

Run npx shadcn@latest add @spectrumui/quantity-stepper. The page also exposes the source for manual installation.

Does Quantity Stepper require Motion?

Yes. Motion usage was detected in the documented source or registry dependencies for Quantity Stepper.

Does Quantity Stepper use shadcn/ui or Radix UI?

No shadcn/ui or Radix UI dependency was detected in the documented Quantity Stepper source.

Can I use Quantity Stepper in Next.js?

The documented React source is used in this Next.js application. Keep its use client directive when copying it into the App Router. Install the detected dependencies and verify any application-specific data or image configuration.

What accessibility checks should I run for Quantity Stepper?

The source includes ARIA markup, keyboard handlers, reduced-motion handling. Test the finished interface with keyboard and screen-reader workflows.