TextInput

Beta notice: This page is being built.Edit on GitHub(opens in new tab)

Edits themed text with optional local state and native form serialization. Required fields cannot be blank.

longlink docs component "TextInput"

Example

Properties

TextInput - Properties
labelstring
Label text for the input: always rendered for accessibility.
descriptionstring
Description text displayed between the label and input.
namestring
Includes the themed control's value under this form submission name.
requiredboolean
Requires a value before native form submission.
disabledboolean
Prevents interaction and excludes the field from submission.
valuestring
Current value of the input.
defaultValuestring
Initial value.
onChange(value: string) => void
Callback fired when the input value changes.
placeholderstring
Placeholder text shown when the input is empty.
maxLengthnumber
Maximum Unicode code points, matching Python string length. Validates without truncating input.
type"text" | "password" | "email"
The HTML input type.
autoCompletestring
Native autocomplete hint.
startIconReactNode
Icon displayed at the start of the input.
onEnter() => void
Runs on Enter, except when confirming an IME composition.