Forms are where requirements mutate
Every stakeholder meeting adds a field. If the form architecture is ad hoc, each change risks regressions in validation and accessibility.
Schema-first validation
We prefer a shared schema (for example Zod) that can run on the client and mirror server rules. Duplicated hand-written validators drift.
Structure for change
- Field components that own label, error, and description wiring
- Field arrays for repeating sections (line items, addresses)
- Explicit dirty/submit states so users know what happened
- Server error mapping back to fields, not only toast noise
Accessibility is not optional
Errors must be associated with inputs. Keyboard users need a clear focus order. If the form is long, group with headings and legends.
When to multi-step
Multi-step wizards help when cognitive load is high — not when you just want a prettier progress bar. Persist drafts if sessions are long.
This is the boring craft behind many Rayaxis React deliveries: forms that operations teams trust.