Give the field a visible label where possible. Use placeholder for an example value or input
format, not as the label. A placeholder disappears while someone types and is not a reliable
accessible name.
When a nearby heading already names the field, omit label. Use aria-label or aria-labelledby
instead.
Set isRequired when the field must have a value. By default, a required text input shows a marker
after its label. Read Required fields for the necessityIndicator
values.
Set isRequired, type, or pattern, or pass validate to check the value. TextInputField
shows its validation message after validation fails. Pass errorMessage only for an error you
already have, such as one from a form library or your server. A non-empty message marks the field
invalid. Read Validation for where messages come from, server errors, and how to
write them.
Use prefix and suffix for content inside the input, such as a search icon, currency code, or URL
scheme. Both accept any ReactNode. Give an interactive prefix or suffix an accessible name and
keyboard behaviour.
Use size to set the input height and typography. Use small in compact layouts. medium is the
default. The HTML numeric size attribute is unavailable because size is the Luke UI variant. On
touch devices, small uses the body text size so iOS Safari doesn't zoom into the field on focus.
TextInputFieldProps also accepts compatible DOM and ARIA attributes and event handlers for its rendered element.
Name
Type
Default
autoCorrect
string
Default: —
An attribute that takes as its value a space-separated string that describes what, if any, type
of autocomplete functionality the input should provide. See
MDN.
description
ReactNode
Default: —
Optional helper text shown below the control.
errorMessage
ReactNode
Default: —
Validation message for a controlled error. A non-empty message marks the field invalid.