Number Input
Stepper with press-and-hold repeat, ↑/↓ (Shift ×10), Home/End, clamping, precision and Intl display formatting.
4 files · 306 locdeps: clsx, tailwind-merge
Installation
With the shadcn CLI, pointing at this platform’s registry:
npx shadcn@latest add https://opusui.131199999.xyz/r/number-input.jsonOr offline, straight from your opus55 checkout (copies every file it needs):
node ../tailwind_component/opus55/scripts/add.mjs number-inputUsage
import { NumberInput } from "@/components/opus/ui/number-input";
<NumberInput value={qty} onValueChange={setQty} min={1} max={20} />API
| Prop | Type | Default | Description |
|---|---|---|---|
| value / defaultValue / onValueChange | number | — | Value. |
| min / max / step / precision | number | — | Bounds and stepping. |
| format | Intl.NumberFormatOptions | — | Display format while not editing. |
| controls | "split" | "stacked" | "split" | Button layout. |