TextField
TextField(
props):Element
A line of text a player types.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
props |
{ className?: string; disabled?: boolean; label: string; onChange: (text) => void; onCommit?: (text) => void; placeholder?: string; ref?: Ref<HTMLInputElement>; value: string; } |
- |
props.className? |
string |
An override that shows in the diff. |
props.disabled? |
boolean |
Off: dimmed, and it takes no typing. |
props.label |
string |
The accessible name. The field draws no label of its own: the layout around it does. |
props.onChange |
(text) => void |
Called with the text at each key. |
props.onCommit? |
(text) => void |
Called with the text when the player presses Enter or leaves the field, for a change worth making once, such as a save. |
props.placeholder? |
string |
What the empty field shows. |
props.ref? |
Ref<HTMLInputElement> |
For the layout that moves the focus here. |
props.value |
string |
- |
Returns
Section titled “Returns”Element