One-click install
npx skills add https://github.com/Impertio-Studio/shadcn-ui-Claude-Skill-Package --skill shadcn-syntax-form
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: shadcn-syntax-form
Source: https://github.com/Impertio-Studio/shadcn-ui-Claude-Skill-Package/tree/main/skills/source/shadcn-syntax/shadcn-syntax-form
Command: npx skills add https://github.com/Impertio-Studio/shadcn-ui-Claude-Skill-Package --skill shadcn-syntax-form

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Confusing or fragile shadcn ui form composition causes validation to fail silently, error messages not to render, values not to reach the submit handler, or React to warn about uncontrolled-to-controlled inputs.

Core Features & Use Cases

  • Wires the seven shadcn Form primitives correctly: Form, FormField, FormItem, FormLabel, FormControl, FormDescription, and FormMessage so aria IDs and zod error rendering work every time.
  • Provides a schema-first react-hook-form + zodResolver setup: derives TypeScript types from the zod schema and ensures handleSubmit triggers validation.
  • Prevents the most common integration failures: uses the Controller path (not register) for Radix-wrapped controls, ensures defaultValues are never undefined, and handles async refine safely under React Server Components constraints.

Quick Start

Tell Claude: build a shadcn ui react-hook-form + zod form using the seven primitives with a schema-first useForm setup, correct Controller binding for any Radix controls, proper defaultValues, and async refine that renders FormMessage errors reliably.

Frequently Asked Questions about shadcn-syntax-form

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
Why does my shadcn ui form validation fail silently when using react-hook-form and zod?

shadcn ui form validation fails silently when the seven Form primitives are incorrectly composed, breaking aria ID wiring and zod error rendering. Correctly wiring FormField, FormItem, and FormMessage ensures zodResolver validation errors reach the UI reliably.

How do I wire Radix controlled components like Select and Checkbox with react-hook-form in shadcn ui?

Wire Radix controlled components in shadcn ui by using the Controller component from react-hook-form instead of register. Bind Radix props directly using value/onValueChange for Select and checked/onCheckedChange for Checkbox to ensure values reach the submit handler.

How do I set up a schema-first useForm with zodResolver for shadcn ui forms?

Set up a schema-first useForm by defining a stable module-scope zod schema, passing it to zodResolver, and deriving TypeScript types from it. Always provide defined defaultValues to prevent uncontrolled-to-controlled input warnings in shadcn ui forms.

Do I need to add "use client" for shadcn ui forms in React Server Components?

Yes, you need to add the "use client" directive to establish RSC-safe boundaries for shadcn ui forms. react-hook-form state and Radix controlled components require client-side execution, so the Form component tree must be marked as a client component.

How do I handle async refine with zod in a shadcn ui form without losing error rendering?

Handle async refine safely in zod by ensuring the FormMessage component renders the resolved validation errors. The react-hook-form handleSubmit function must be passed as the native form onSubmit handler to trigger both sync and async zod validation correctly.

Why does React warn about uncontrolled-to-controlled inputs in my shadcn ui form?

React warns about uncontrolled-to-controlled inputs when defaultValues are undefined in the useForm setup for shadcn ui forms. Providing explicitly defined defaultValues for every field in the zod schema prevents this state mismatch during Radix component binding.