NumberInput()function

NumberInput({
	name,
	title = "",
	placeholder = title, // Placeholder must be defined or `:placeholder-shown` CSS rules won't show.
	required = false,
	disabled = false,
	message = "",
	value,
	onValue,
	// min = Number.NEGATIVE_INFINITY,
	// max = Number.POSITIVE_INFINITY,
	formatter = formatNumber,
	...variants
}: NumberInputProps): ReactElement
ParamType
variantsNumberInputProps
Props for NumberInput, a text-based numeric input bound to a number value. required
    .minnumber
    .maxnumber
    .formatterNumberFormatter
Optional formatter — when provided the input switches to type="text" and reformats the value on blur.
Return
ReactElement
A numeric <input> element.

Numeric input bound to a number value, parsing typed text and reformatting it on blur.

  • Uses type="text" with inputMode="decimal" so a custom formatter can control display.

Examples

<NumberInput name="age" value={age} onValue={setAge} />