Skip to main content

Type Alias: ZodFormsConfig<TComponents, TSchemas>

ZodFormsConfig<TComponents, TSchemas> = object

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

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:136


defaults?

optional defaults?: ConfigDefaults

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


exclude?

optional exclude?: string[]

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


fields?

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

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


include?

optional include?: string[]

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


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:142


types?

optional types?: string[]

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