Home Components Form
React Form Components
10 free React forms built with Tailwind CSS and shadcn/ui conventions. Copy the code or install with the shadcn CLI. Great for validation with react-hook-form and zod, sign up, and settings forms.
Form 1 : Verification form with a six-digit OTP field, zod validation for a complete code and a success toast.Form 2 : Account recovery form with a select listing accounts by avatar and email, validated with zod.Form 3 : Birth date form with a calendar popover that blocks future dates and dates before 1900.Form 4 : Mode picker form with radio option cards and an error if submitted without a choice.Form 5 : Consent form with a bordered checkbox card that must be ticked before Get Started succeeds.Form 6 : Settings form with a switch in a bordered row that must be turned on to continue.Form 7 : Feedback form with a textarea validated to between 30 and 300 characters.Form 8 : Category form with a searchable combobox, an icon for each option and a check on the chosen one.Form 9 : Invite form with a single email input validated for a correct address before sending.Form 10 : Project setup card form with email, project type select, goal toggles and a brief textarea, all validated.
About React Form Components A React form collects user input, validates it, and submits it. Watermelon UI forms are built with react-hook-form and zod through @hookform/resolvers, using shadcn Field components for labels, descriptions, and error messages, styled with Tailwind CSS. Add one with the shadcn CLI, then edit the zod schema and fields to match your data.
When to use it Sign-up, login, and contact forms with field-level errors. Settings pages that save several values at once. Multi-field flows that need typed values and schema validation. When to use something else Use Dialog when the form is short and should open over the current page. Use Input OTP when the form only asks for a one-time code. Frequently asked questions How do I validate a shadcn form with zod? Define a zod schema and pass zodResolver(schema) as the resolver option to useForm. Field errors then come from the schema and show next to each field.
How do I connect a shadcn Select or Checkbox to react-hook-form? Wrap it in a Controller and map field.value and field.onChange to the component’s value and change props. These components are not native inputs, so register alone does not work.
How do I reset a form after submit? Call form.reset() from useForm after the submit succeeds. Pass new values to reset if the form should show the saved data.
How do I show a server error on a field? Call form.setError with the field name and a message after the request fails. Use a root key, like "root.serverError", for errors that belong to the whole form.
How to use React Form Components Start from a React project with Tailwind CSS and shadcn/ui set up. Next.js, Vite, Remix, and Astro all work. Run npx shadcn@latest add https://registry.watermelon.sh/r/form-1.json to add the source files to your project. Import it where you need it, then edit the Tailwind classes and design tokens to match your product. Dependencies installed with it: @hookform/resolvers, react-hook-form, react-icons, sonner, zod, date-fns, lucide-react.
The code is yours: it lives in your repository, so there is no runtime package to keep updated. Watermelon UI is free and open source under the MIT license.
More: Free React components , UI library alternatives , guides .