FormConfig
| Generic types: | TFields TValue |
Configuration interface for defining dynamic form structure and behavior.
This interface defines the complete form schema including field definitions, validation rules, conditional logic, and submission handling using Angular's signal-based reactive forms.
Properties
| Name | Type | Description |
|---|---|---|
| customFnConfig | | Signal forms adapter configuration. |
| defaultValidationMessages | | Form-level validation messages that act as fallback for field-level messages. These messages are used when a field has validation errors but no field-level |
Example usage | ||
| fields | TFields | Array of field definitions that define the form structure. Fields are rendered in the order they appear in this array. Supports nested groups and conditional field visibility. |
Example usage | ||
| options | | Global form configuration options. Controls form-wide behavior like validation timing and disabled state. @value {} |
| schema | Schema<TValue> | undefined | Optional form-level validation schema. Provides additional validation beyond field-level validation. Useful for cross-field validation rules. |
Example usage | ||
| schemas | | Global schemas available to all fields. Reusable validation schemas that can be referenced by field definitions. Promotes consistency and reduces duplication. |
Example usage | ||
| submission | | Form submission configuration. When provided, enables integration with Angular Signal Forms' native While the submission action is executing, Server errors returned from the action will be automatically applied to the corresponding form fields. |
Example usage | ||
Example usage
const formConfig = {
fields: [
{ type: 'input', key: 'email', value: '', label: 'Email', required: true },
{ type: 'group', key: 'address', label: 'Address', fields: [
{ type: 'input', key: 'street', value: '', label: 'Street' },
{ type: 'input', key: 'city', value: '', label: 'City' }
]},
],
} as const satisfies FormConfig ;
// Infer form value type from config
type FormValue = InferFormValue <typeof formConfig>;