Quantity Stepper

React quantity stepper with minus and plus buttons around a tabular count. Clamps to min and max, disables at the limits, and works controlled or uncontrolled.

src/registry/ui/quantity-stepper.tsx/r/quantity-stepper.json

Installation#

bash
npx shadcn@latest add @minidev/quantity-stepper

MiniDev UI is in the shadcn registry directory, so the short form works with no setup. Older CLI versions can use the full URL: npx shadcn@latest add https://ui.minidev.pro/r/quantity-stepper.json

Usage#

tsx
import { QuantityStepper } from "@/components/ui/quantity-stepper"

export function Example() {
  return <QuantityStepper />
}

API reference#

QuantityStepper props
PropTypeDefault
valuenumber-
defaultValuenumber1
minnumber1
maxnumber99
onChange(n: number) => void-
classNamestring-

Dependencies#

npm

React only

Built from

All e-commerce components