TextField
<textField>
is an input component that creates an editable single-line box.
<textField>
extends TextBase
and EditableTextBase
which provide additional properties and events.
See also:
import * as React from "react";
<textField text={textFieldValue} hint="Enter text..." />
Props
Name | Type | Description |
---|---|---|
text | string | Sets the value of the field. |
hint | string | Sets the placeholder text. |
editable | boolean | When true , indicates that the user can edit the value of the field. |
maxLength | number | Limits input to the spcified number of characters. |
secure | boolean | Hides the entered text when true . Use this property to create password input fields.Default value: false . |
keyboardType | KeyboardType | Shows a custom keyboard for easier text input. Valid values: datetime , phone , number , url , or email . |
returnKeyType | ReturnKeyType | Sets the label of the return key. Valid values: done , next , go , search , or send . |
autocorrect | boolean | Enables or disables autocorrect. |
onBlur | (args: EventData ) => void | Emitted when the field loses focus. |
onFocus | (args: EventData ) => void | Emitted when the field gains focus. |
onReturnPress | (args: EventData ) => void | Emitted when the return key is pressed. |
onTextChange | (args: EventData ) => void | Emitted when the text changes. |
Native component
Android | iOS |
---|---|
android.widget.EditText | UITextField |