forms

Implement validated React forms with react-hook-form and shadcn/ui components.

Updated Mar 27, 2026
One-click install
npx skills add https://github.com/madmaxfarm105-hue/Comando --skill forms-madmaxfarm105-hue
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: forms
Source: https://github.com/madmaxfarm105-hue/Comando/tree/main/.emdash/skills/forms
Command: npx skills add https://github.com/madmaxfarm105-hue/Comando --skill forms-madmaxfarm105-hue

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you avoid fragile form handling by providing consistent patterns for collecting user input, validating it, and rendering accessible form controls.

Core Features & Use Cases

  • Core Setup with react-hook-form: Standardizes field registration, submission handling, and common utilities like reset, watch, and setValue.
  • Validation Rules & Error Display: Provides required, min/max length, regex pattern, custom validation, and conditional validation examples (e.g., email, phone, URL, password rules).
  • shadcn/ui Form Components Patterns: Shows how to integrate react-hook-form with shadcn/ui Form wrappers for better accessibility and consistent UI.
  • Form Submission to CMS: Demonstrates saving form submissions into a CMS collection (e.g., creating a contact-submissions record) and resetting the form afterward.
  • Input Component Patterns: Covers common UI controls like Input, Textarea, Select, Checkbox, RadioGroup, and Switch.

Quick Start

Use this skill to implement a contact form with react-hook-form validation and shadcn/ui components that saves submissions to your CMS and resets the form after success.

Frequently Asked Questions about forms

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

FAQPage Schema
How do I build validated React forms with react-hook-form and shadcn/ui?

Build validated React forms by registering fields with react-hook-form and wrapping inputs in shadcn/ui Form components for accessible error messaging. This standardizes field-level validation, handles submissions, and manages UI controls like Input, Select, and Checkbox.

How does conditional validation work in react-hook-form?

Conditional validation in react-hook-form applies rules dynamically based on other field values using custom validation functions. You can enforce required fields, regex patterns, and min/max lengths that trigger only when specific conditions are met.

Can I save react-hook-form submissions to a CMS collection?

Yes, you can save react-hook-form submissions to a CMS collection by creating records like contact-submissions during the form submission flow. After successfully persisting the data, reset the form using the reset utility.

Does this form validation approach support accessible error messaging?

Yes, integrating react-hook-form with shadcn/ui Form components provides accessible error messaging by standardizing field registration and error display. This ensures validation errors are properly linked to input controls for screen readers.

What is the best way to manage complex form state and inputs in React?

Manage complex form state using react-hook-form utilities like watch, setValue, and reset alongside shadcn/ui components. This handles field registration, conditional validation rules, and multiple input types without fragile state management.

Why does my React form state reset incorrectly after submission?

Incorrect form state resets often happen when submission flows lack proper handling. Use react-hook-form's reset utility after successfully saving data to a CMS collection to clear inputs and restore default values reliably.