NestedTableConfig
NestedTableConfig<
TTable,TAs> =object
Defined in: packages/forms/src/types.ts:260
Configuration for a nested child table rendered as a dynamic field array under an AutoForm.
This is the successor to the deprecated ChildTableConfig record
shape. Pass an array of these via the AutoForm nested prop:
<AutoForm table={recipes} nested={[ { table: ingredients, foreignKey: "recipeId", min: 1, max: 50, reorderable: true, fields: { name: { placeholder: "Flour" } }, }, ]} onSubmit={async (values) => { // values.ingredients is fully typed — no casts needed. }}/>The array shape (as opposed to Record<string, ChildTableConfig>) avoids
the JSX-reserved children attribute collision and enables the whole form
value type to be inferred via InferAutoFormValues.
The key the nested array appears under in the submitted values is either:
as(explicit override), or- the table’s runtime name from
getTableName(table)(e.g.sqliteTable("ingredients", ...)→ingredients).
Type Parameters
Section titled “Type Parameters”TTable
Section titled “TTable”TTable extends Table = SQLiteTable
TAs extends string | undefined = string | undefined
Properties
Section titled “Properties”addLabel?
Section titled “addLabel?”
optionaladdLabel:string
Defined in: packages/forms/src/types.ts:293
Override the “Add row” button label.
optionalas:TAs
Defined in: packages/forms/src/types.ts:279
Override the key the nested array appears under in submitted form values.
Defaults to the table’s runtime name (e.g. sqliteTable("ingredients", …)
→ "ingredients"). Pass as when two nested tables would otherwise
collide, or when you want the form key to differ from the table name.
exclude?
Section titled “exclude?”
optionalexclude: keyofInferTableRow<TTable> &string[]
Defined in: packages/forms/src/types.ts:289
Additional column names to omit from the rendered nested rows.
fields?
Section titled “fields?”
optionalfields:Partial<Record<keyofInferTableRow<TTable> &string,FieldConfig>>
Defined in: packages/forms/src/types.ts:287
Per-column overrides for the nested table fields, identical in shape to the parent FieldConfig.
foreignKey
Section titled “foreignKey”foreignKey: keyof
InferTableRow<TTable> &string
Defined in: packages/forms/src/types.ts:271
Foreign key column on the nested table that points back at the parent. The column is automatically excluded from the rendered nested fields and stamped onto each row at submit time.
label?
Section titled “label?”
optionallabel:string
Defined in: packages/forms/src/types.ts:291
Override the heading rendered above the nested table (defaults to a humanised key).
optionalmax:number
Defined in: packages/forms/src/types.ts:283
Maximum number of rows the user is allowed to add. Defaults to unlimited.
optionalmin:number
Defined in: packages/forms/src/types.ts:281
Minimum number of rows the user must provide. Defaults to 0.
reorderable?
Section titled “reorderable?”
optionalreorderable:boolean
Defined in: packages/forms/src/types.ts:285
Show reorder controls (move up / move down). Defaults to false.
table:
TTable
Defined in: packages/forms/src/types.ts:265
The Drizzle SQLite table that backs each row of the array.