Forms System Rebuild - Zod Validation
Author: 18-thCreated May 19, 2026Updated Sep 14, 2026
Labelsv4.0
Pain
Validation is inconsistent across the form layer. Some fields validate locally, some rely on ad hoc checks, and cross-field validation is effectively manual. That makes validation behaviour hard to predict, hard to test and hard for plugin or host application code to extend safely.
Approach
Introduce Zod-backed validation for all fields. Field-level validation, custom validators and cross-field rules are defined through one validation path so the form layer can report errors consistently regardless of field type or source.
Expected outcomes
- Every field type has a consistent validation path.
- Custom validation can be added without forking the form layer.
- Cross-field validation is supported as a first-class form capability.
- Validation errors are surfaced consistently in the editor UI.
Acceptance Criteria
- All built-in field types can run validation through Zod.
- Custom validators can be registered and composed with field validation.
- Cross-field validation can inspect sibling or form-level values.
- Validation errors surface consistently next to fields and in any form-level error summary.
- Validation runs at the expected lifecycle points: edit, blur and submit where appropriate.
- Tests cover valid input, invalid input, custom validation and cross-field validation.
Source: tinacms/tinacms