Back to components

Primitives

Quantity Stepper

A controlled quantity input with accessible increment and decrement buttons that clamp to min and max.

input
controls
accessible

Preview

Installation

Run the shadcn CLI. Dependencies and the shared lib block come with it.

npx shadcn add quantity-stepper

Usage

Import
import { QuantityStepper } from "@/components/lumo/quantity-stepper"
Example
const [qty, setQty] = useState(1)

<QuantityStepper value={qty} onValueChange={setQty} min={1} max={9} />

Props

PropTypeDefaultRequired
valuenumber-
Required
onValueChange(value: number) => void-
Required
minnumber1
maxnumber-
disabledboolean-
size"sm" | "md""md"
labelstring-

All props accept standard HTML attributes unless otherwise specified.

Dependencies

npm packages

lucide-react

Own every line

Lumo blocks copy into your repo. No runtime dependency, no lock-in. Edit the code to fit your product.