Quantity Control
Increment/decrement quantity spinner with min/max bounds and size variants.
Installation
pnpm dlx shadcn@latest add https://jb.desishub.com/r/quantity-control.json
Usage
import { QuantityControl } from "@/components/quantity-control";const [qty, setQty] = useState(1);
<QuantityControl value={qty} onChange={setQty} />
<QuantityControl value={qty} onChange={setQty} size="lg" min={0} max={10} />Props
| Prop | Type | Default | Description |
|---|---|---|---|
value | number | - | Current quantity. |
onChange | (value: number) => void | - | Called on value change. |
min | number | 1 | Minimum value. |
max | number | 99 | Maximum value. |
size | "sm" | "default" | "lg" | "default" | Control size variant. |
disabled | boolean | false | Disable the control. |

