Skip to main content

Type Alias: ZodFormsConfig<TComponents, TSchemas>

ZodFormsConfig<TComponents, TSchemas> = object

Defined in: packages/core/dist/config.d.ts:97

Root configuration type for zod-to-form code generation.

Describes the component library to use, generation defaults, per-schema overrides, and global field configuration. Pass this to defineConfig() in your z2f.config.ts for full type inference, or load and validate it at runtime with validateConfig().

Type Parameters

TComponents

TComponents extends Record<string, unknown> = Record<string, unknown>

Shape of the component module (used to type fields.component).

TSchemas

TSchemas extends Record<string, unknown> = Record<string, unknown>

Map of schema export names to their Zod schema types (used to type schemas.[key].fields).

Properties

components

components: ComponentsConfig<TComponents>

Defined in: packages/core/dist/config.d.ts:98


defaults?

optional defaults?: ConfigDefaults

Defined in: packages/core/dist/config.d.ts:99


exclude?

optional exclude?: string[]

Defined in: packages/core/dist/config.d.ts:102


fields?

optional fields?: Record<string, TypedFieldConfig<TComponents>>

Defined in: packages/core/dist/config.d.ts:103


include?

optional include?: string[]

Defined in: packages/core/dist/config.d.ts:101


schemas?

optional schemas?: { [K in keyof TSchemas & string]?: ZodTypeConfig<TSchemas[K] extends $ZodType ? SchemaFieldPath<TSchemas[K]> : string, TComponents> }

Defined in: packages/core/dist/config.d.ts:104


types?

optional types?: string[]

Defined in: packages/core/dist/config.d.ts:100