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| Param | Type | |
|---|---|---|
variants | NumberInputProps | Props for NumberInput, a text-based numeric input bound to a number value. required |
.min | number | |
.max | number | |
.formatter | NumberFormatter | 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"withinputMode="decimal"so a customformattercan control display.
Examples
<NumberInput name="age" value={age} onValue={setAge} />