Skip to content

TextFieldInput

const TextFieldInput: (props) => Element

Defined in: packages/react/src/components/fields/text/Input.tsx:37

Text field input component for the admin edit form.

Built with createFieldInput — handles TanStack Form wiring automatically. Must be rendered inside <AppForm>, or receive an explicit field prop (TypedFieldApi<string>) from a <form.Field> render prop.

The name prop is the field key from the collection config (e.g. "title"). It connects the input to the form field with that key in form.defaultValues.

InputComponentProps<{ }, TextField<{ }>> & object

Element

// Inside CollectionEditView — AppForm provides context
<AppForm form={form}>
<TextFieldInput name="title" fieldDef={titleField} readOnly={false} />
</AppForm>
// Explicit field prop — TypedFieldApi<string>, works outside AppForm
<form.Field name="title">
{(field) => (
<TextFieldInput
name="title"
fieldDef={titleField}
readOnly={false}
field={field}
/>
)}
</form.Field>