NumberInput
NumberInput is an Input pinned to type="number" with a numeric input mode. Reach for it
whenever the field holds a number rather than free text.
What it is
An Input with type="number" and inputMode="numeric" set. Everything else — the
Field-context wiring, the invalid prop, the forwarded ref — comes straight from Input. The
numeric input mode shows the number keypad on touch devices.
Install
NumberInput is exported from usemotif. No separate install.
API
NumberInput
stableconst NumberInput: ForwardRefExoticComponent<NumberInputProps & RefAttributes<HTMLInputElement>>
Every Input prop except `type`, which is fixed to `number`. `min`, `max`, `step`, `invalid`, and the rest pass through.
Accessibility
NumberInput inherits Input's contract — id, aria-describedby, invalid and required state from
Field context. The numeric input mode is an enhancement for touch keyboards, not an accessibility
guarantee: it does not constrain what can be entered. Pair min, max, and step with your own
validation when the value range matters.
Examples
A quantity field inside a Field:
A controlled numeric value: