form-react

Build React forms with React Hook Form and Zod validation.

8|3|Updated Dec 12, 2025
One-click install
npx skills add https://github.com/Bbeierle12/Skill-MCP-Claude --skill form-react
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: form-react
Source: https://github.com/Bbeierle12/Skill-MCP-Claude/tree/main/skills/form-react
Command: npx skills add https://github.com/Bbeierle12/Skill-MCP-Claude --skill form-react

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires react, react-hook-form, @hookform/resolvers, zod, and includes references (resource) and scripts (resource) components.

What problem does it solve?

This Skill provides production-ready React form patterns using React Hook Form with Zod integration to deliver fast, accessible, and maintainable forms.

Core Features & Use Cases

  • RHForm + Zod: Declarative forms with strong validation and TypeScript types.
  • Controlled + Uncontrolled patterns: Flexible patterns for various UX needs.
  • Use Case: Build a login form with real-time validation and a responsive UX.

Quick Start

Install dependencies, define a Zod schema, hook into useForm with zodResolver, and implement submit handling.

Frequently Asked Questions about form-react

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

FAQPage Schema
How do I build forms with React Hook Form and Zod validation?

React Hook Form with Zod integration lets you build forms using schema-driven validation. Define a Zod schema, apply zodResolver to useForm, and bind FormField components to your form state. This pattern delivers real-time validation with TypeScript type safety and minimal re-renders.

What's the difference between onBlur and onChange validation modes in React forms?

onBlur validation checks fields when users leave them, reducing noise during typing. onChange validates continuously as users type. React Hook Form's reValidateMode: 'onChange' with mode: 'onBlur' combines both: validate on blur, then re-validate on every change afterward for a responsive experience.

Can I use React Hook Form with TypeScript and get type-safe form validation?

Yes. React Hook Form with Zod provides full TypeScript support through zodResolver, which infers types directly from your Zod schema. This ensures form fields, validation rules, and submit handlers are all type-checked, catching errors at compile time.

How do I handle controlled and uncontrolled form patterns in React?

Controlled patterns bind inputs to React state; uncontrolled patterns rely on refs and the DOM. React Hook Form supports both approaches, letting you choose based on UX needs. Use controlled for real-time validation and filtering; uncontrolled for simpler, performance-sensitive forms.

Do I need additional libraries beyond React Hook Form and Zod for production forms?

React Hook Form with Zod covers most needs. For multi-framework scenarios, the Skill optionally supports TanStack Form. For production forms in React specifically, @hookform/resolvers connects Zod to React Hook Form, and reusable FormField and FormProvider components handle the rest.

When should I use schema-driven validation instead of manual field validation?

Schema-driven validation with Zod centralizes rules in one place, making them reusable across client and server, easier to test, and safer to refactor. Use it for any form complex enough to benefit from type safety and version control of validation logic.