FieldConfig
FieldConfig =
object
Defined in: packages/forms/src/types.ts:88
Per-field overrides for customizing auto-generated form fields.
Pass a record of { [columnName]: FieldConfig } to the AutoForm fields prop
to override labels, placeholders, visibility, defaults, components, or validation
for individual fields.
Example
Section titled “Example”<AutoForm table={posts} mode="create" fields={{ title: { label: "Post Title", placeholder: "Enter a title..." }, content: { component: RichTextEditor }, authorId: { hidden: true, default: currentUser.id }, }} onSubmit={handleSubmit}/>Properties
Section titled “Properties”component?
Section titled “component?”
optionalcomponent:React.ComponentType<FieldComponentProps>
Defined in: packages/forms/src/types.ts:98
Custom React component to render instead of the plugin’s default for this input type.
default?
Section titled “default?”
optionaldefault:unknown
Defined in: packages/forms/src/types.ts:96
Default value for the field in create mode.
hidden?
Section titled “hidden?”
optionalhidden:boolean
Defined in: packages/forms/src/types.ts:94
Hide this field from the rendered form. The field is still submitted if a default is set.
label?
Section titled “label?”
optionallabel:string
Defined in: packages/forms/src/types.ts:90
Override the auto-generated label for this field.
placeholder?
Section titled “placeholder?”
optionalplaceholder:string
Defined in: packages/forms/src/types.ts:92
Placeholder text shown inside the input.
validate()?
Section titled “validate()?”
optionalvalidate: (value) =>string|undefined
Defined in: packages/forms/src/types.ts:100
Custom validation function. Return an error message string to fail, or undefined to pass.
Parameters
Section titled “Parameters”unknown
Returns
Section titled “Returns”string | undefined