react-formgen

Stop writing forms from scratch. React FormGen is a headless, type-safe, and customizable form generator that turns your data schemas into fully functional React forms and data views with minimal effort. By providing a schema from popular libraries like JSON Schema, Zod, or Yup, you can automate form creation, validation, and state management, letting you focus on building features, not boilerplate.


Key Features

  • Schema-Driven & Type-Safe ✍️ Define your data structure once using JSON Schema, Zod, or Yup, and let React FormGen handle the rest. It generates forms that are always in sync with your schema, providing end-to-end type safety and consistent validation.
  • Truly Headless by Design 🎨 Bring your own components. React FormGen is completely unopinionated about your UI. It provides the logic, state, and hooks, allowing you to use any component library—from Material UI and Shadcn to your own custom design system—for complete visual control.
  • Infinitely Customizable ⚙️ Every part of the form is customizable. Override the default rendering logic by providing your own templates for any data type—strings, numbers, arrays, objects, and more. You have full control over the markup, styling, and behavior of every field.
  • Efficient & Modern State Management ⚡ Built on a robust core using Zustand, React FormGen offers fast and scalable state management out of the box. It's lightweight, performant, and includes optional debugging with Redux DevTools to inspect form state in real-time.

Perfect For:

  • Rapidly prototyping and building complex forms.
  • Projects requiring a consistent, end-to-end validation strategy between frontend and backend.
  • Dynamically generating forms for a CMS, form builder, or configuration tool.
  • Developers who want to avoid repetitive form boilerplate and focus on application logic.

Take control of your forms. Check out the project on GitHub!