Text Inputs
TextInput and TextareaInput combine native text controls with Payload's label, description, validation, and read-only field presentation. Use them when building a Custom Field that manages its own value.
Import
TextInput
TextInput is controlled. Pass the current string through value and update it from the native change event.
Set hasMany to render Payload's sortable multi-value text control instead of a native input.
TextareaInput
Use rows to establish the initial height. The value remains controlled by the surrounding Custom Field.
Common props
These props are shared by both inputs unless noted otherwise.
Prop | Type | Default | Description |
|---|---|---|---|
| | — | Identifies the field and connects its UI. |
| | | Supplies the controlled value. |
| | — | Receives native input changes. |
| | — | Displays Payload's field label. |
| | — | Displays helper text beneath the input. |
| | — | Displays translated placeholder text. |
| | | Displays the required marker. |
| | | Disables editing and applies read-only styles. |
| | Form | Displays the current validation error. |
| | — | Inserts content before the native control. |
| | — | Inserts content after the native control. |
| | — | Sets the TextareaInput row count. |
| | | Enables TextInput's multi-value mode. |
* An asterisk denotes that a prop is required.
Custom field usage
Inside a Custom Field, connect the input to Payload's form state with useField:
Provider requirements
The Admin Panel supplies the translation and form contexts used by the built-in label, description, and validation components. Use these inputs inside a Payload Custom Field, or provide equivalent contexts when rendering them elsewhere.
Was this page helpful?