Quantity Stepper
A pill with minus and plus buttons around a live count. Buttons disable at the limits and stay 44px tall on touch screens.
npx shadcn@latest add https://ui.develop-better-solutions.com/r/quantity-stepper.jsonDependencies:
lucide-reactQuantity
2
Between 1 and 5
Usage
quantity-stepper-example.tsx
"use client";
import { useState } from "react";
import { QuantityStepper } from "@dbs/ui";
export default function QuantityStepperExample() {
const [q, setQ] = useState(2);
return (
<div className="flex flex-col items-center gap-3">
<QuantityStepper value={q} onChange={setQ} min={1} max={5} />
<p className="text-xs text-ink-muted">Between 1 and 5</p>
</div>
);
}