Forms
Number Input
A stepper input with increment / decrement buttons, min/max/step constraints, and three sizes.
Quick Preview
Installation
// Copy NumberInput.tsx to your components/forms/ folder// src/components/forms/NumberInput.tsx
Usage
import { NumberInput } from '@/components/forms/NumberInput'const [count, setCount] = useState(0)<NumberInputvalue={count}onChange={setCount}min={0}max={100}step={1}label="Count"/>
Examples
Sizes
E-commerce Cart Quantity
of 10 in stock
Prompt Preview
Copy a prompt that recreates this UI
Paste this into your AI coding assistant to generate code that closely matches the reference, including color, size, shape, typography, spacing, and polish.
Copy-ready AI prompt
Starts from the current visual reference and project constraints.
Tweak only product-specific copy or data after the first generation pass.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
value* | number | - | Current numeric value |
onChange* | (value: number) => void | - | Called with new value on change |
min | number | -Infinity | Minimum allowed value |
max | number | Infinity | Maximum allowed value |
step | number | 1 | Amount added/subtracted per click |
label | string | - | Optional label displayed above the input |
disabled | boolean | - | Disable all interactions |
size | "sm" | "md" | "lg" | "md" | Size of the input |