Not affiliated with official shadcn/ui. Visit ui.shadcn.com for official docs.
React Two Field Form
A React form with two fields for name and email using React Hook Form and Zod validation for simple contact forms built with shadcn/ui
Looking to implement shadcn/ui patterns?
Join our Discord community for help from other developers.
Contact forms need just enough fields to reach users without overwhelming them. This React form combines name and email validation using React Hook Form with Zod—minimum 2 characters for names, proper email format checking. Built with shadcn/ui Form components with space-y-4 vertical spacing and inline errors, it's perfect for newsletter signups, contact requests, or waitlist forms where you need basic contact info.
Pattern created by @haydenbleasel
Installation
Related patterns you will also like
Simple Text Input Form
Single field with validation
Three Field Form
Name split with grid layout
Email Input Form
Email-only validation
Mixed Input Types Form
Multiple different input types
Dialog Form
Form inside modal dialog
Form with Optional Fields
Required and optional fields mixed
Questions you might have
React Spacious Form with Sections
A React form with generous spacing using space-y-8 and logical sections for Personal Information and Address with headings
React Three Field Form
A React form with three fields using grid layout for firstName and lastName side-by-side with email below built with shadcn/ui and React Hook Form