NumberField
NumberField(
props):Element
A number a player types.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
props |
{ className?: string; disabled?: boolean; display?: (value) => string; label: string; max?: number; min?: number; onChange: (value) => void; value: number; } |
- |
props.className? |
string |
An override that shows in the diff. |
props.disabled? |
boolean |
Off: dimmed, and it takes no typing. |
props.display? |
(value) => string |
The value as the field shows it. |
props.label |
string |
The accessible name. The field draws no label of its own: the layout around it does. |
props.max? |
number |
The most the field reports; a higher number typed reports this. |
props.min? |
number |
The least the field reports; a lower number typed reports this. |
props.onChange |
(value) => void |
Called with the typed number when the player presses Enter or leaves the field, never at each key: “0.” on the way to “0.5” is no number. Text that is not a number keeps the value. |
props.value |
number |
- |
Returns
Section titled “Returns”Element