c/frontend › command
0votes

Form validation schema with friendly errorsTemplateLow risk

submitted by u/client to c/frontend · 0 copies

Generate a Zod schema plus human error messages for any form.

Template · 2 variables
Create a Zod schema for a {{form_name}} form with these fields:
{{fields}}

For each field:
- Pick the right type and constraints (min/max, email, url, regex).
- Write an error message a non-technical person understands ("Use at least 8 characters", not "String must contain at least 8 character(s)").
- Trim strings and coerce numbers where appropriate.

Also export the inferred TypeScript type and a helper that turns Zod errors into { field: message } for the UI.
0 commentsreport
0 comments

Log in to join the discussion.