Shadcn Syntax Form

Use when building forms with shadcn ui and react-hook-form plus zod, when composing the seven Form primitives (Form, FormField, FormItem, FormLabel, FormControl, FormDescription, FormMessage), when wiring zodResolver to useForm, when deciding between Controller and register for a given input type, when validation errors fail to render under a field, when an input value never reaches the submit handler, or when an input throws a "switched from uncontrolled to controlled" warning. Prevents the common form failures : using register on a non-native control (Select, Checkbox, RadioGroup, Switch) so its value never enters form-state, forgetting FormMessage so zod errors silently never render, defining the zod schema inside the component body so it re-creates every render and kills memoised resolver references, calling handleSubmit without wiring it to the form's onSubmit prop so validation never runs, omitting the outer Form spread so FormField cannot reach the form context, and setting defaultValues to undefined s

Impertio-Studio 45e7020 4 files · 58.9 KB Updated

File contents

impertio-studio/shadcn-ui-claude-skill-package/tree/main/skills/source/shadcn-syntax/shadcn-syntax-form commit 45e7020006

Frequently asked questions

npx skillmds@latest add impertio-studio/shadcn-syntax-form