A numeric input with caret steppers, a unit suffix and min/max clamping. For quantities, prices and counts.
NumberField playground
Install NumberField
1. New project? One command installs the package and wires everything - see Installation:
pnpm dlx zyncat-ui init2. Import the component - it loads its own stylesheet:
import { NumberField } from '@zyncat/ui/number-field';Usage
import { NumberField } from '@zyncat/ui/number-field'; <NumberField label="Seats" unit="users" min={1} max={50} value={seats} onChange={setSeats} />Compose NumberField in your application. No Tailwind or external styling library is required; every value resolves from Zyncat UI's token vocabulary.
NumberField props
NumberField
Frequently asked questions
Pass min (default 0) and max (default Infinity) - typing, the arrow keys and the caret steppers all clamp into that range, and the stepper buttons themselves disable once the value reaches either bound.
Pass unit as a string, e.g. <NumberField unit="users" /> - it renders inside the field, between the digits and the stepper column, without becoming part of the number onChange returns.
No - it renders <input type="text" inputMode="decimal"> with its own digit filter and caret steppers, which sidesteps the native number input's scroll-to-change behavior and inconsistent spin buttons, while inputMode="decimal" still raises the numeric keypad on mobile.
Pass step (default 1) - decimals work, so step={0.5} is valid - and it sets how much each arrow-key press or stepper click adds or removes. Typed values are still clamped to min/max but are not rounded to the step.