React Form Gen
Ship every form. None of the boilerplate.
Create your account
5 min
Time per form
1
Lines of code
WCAG AA
Accessibility
What you can build with it
Real scenarios where this pays for itself.
SaaS sign-up & onboarding
Multi-step wizard with conditional fields. Plan choice, team size, payment — different paths per choice.
Checkout & payment forms
Address, billing, review — with server-side validation that matches your Zod schema byte for byte.
Admin panels & CMS
Create/edit screens for any resource. Type-safe, validated, with the same UX across every entity.
Settings & preferences
Show/hide fields based on the user's plan. Override the password field with your auth UI. Keep the validation.
Built for
If any of these are you, this is for you.
What's under the hood
Three things that earn their place in your stack.
One-line form definition
Hand it a Zod schema and you get a fully-typed, accessible form — labels, error states, focus management included.
Composable when you need it
Custom component slots, field overrides, conditional fields, multi-step wizards. The escape hatches are first-class.
Looks good out of the box
Shadcn-style with Tailwind. Light & dark mode. Bring your own theme tokens and everything tracks.
Quick start
Install and ship in under a minute.
What's in the box
- FormGen componentthe main entry point
- useFormGen hookfor custom layouts
- 8 field componentstext, number, date, select, etc.
- Wizard layoutmulti-step, optional
- Conditional fieldsshow/hide by value
- TypeScript typesfully exported
- Tailwind theme tokensoverride anything
- Full source + docsno obfuscation
Full feature list
What makes this a real product, not a weekend hack.
Works with
Tested against the React stack you already use.
Full documentation
Everything in the package, every prop, every pattern.
React Form Gen
Generate type-safe React forms from Zod schemas. No boilerplate.
Quick Start
npm install react-form-gen zod react-hook-form @hookform/resolvers
Usage
Basic form
import { FormGen } from 'react-form-gen'
import { z } from 'zod'
const schema = z.object({
name: z.string().min(1, 'Name is required'),
email: z.string().email('Invalid email'),
age: z.number().min(18).optional(),
role: z.enum(['admin', 'user', 'guest']),
})
function MyForm() {
return (
<FormGen
schema={schema}
onSubmit={(data) => console.log(data)}
submitLabel="Save"
/>
)
}
With custom field components
<FormGen
schema={schema}
onSubmit={handleSubmit}
fieldComponents={{
email: MyCustomEmailField,
}}
fieldOverrides={{
role: MyCustomRoleSelector,
}}
/>
Multi-step wizard
The layout prop supports 'vertical' (default), 'horizontal', and 'inline'. For multi-step forms, use conditional fields:
const schema = z.object({
step: z.enum(['personal', 'account', 'confirm']),
name: z.string().min(1).optional(),
email: z.string().email().optional(),
password: z.string().min(8).optional(),
})
Conditional fields
// Field config example (internal)
const field = {
name: 'bio',
type: 'textarea',
condition: {
field: 'hasBio',
value: true,
operator: 'equals',
},
}
API
FormGen
| Prop | Type | Default | Description |
|---|---|---|---|
| schema | ZodType | required | The Zod schema to generate the form from |
| onSubmit | (data: T) => void | required | Called with validated data |
| defaultValues | Partial<T> | — | Initial form values |
| className | string | '' | CSS class on the form element |
| fieldComponents | Record<FieldType, Component> | — | Override renders per field type |
| fieldOverrides | Record<string, Component> | — | Override renders per field name |
| submitLabel | string | 'Submit' | Submit button text |
| showReset | boolean | false | Show reset button |
| hideLabels | boolean | false | Hide field labels |
| layout | 'vertical' | 'horizontal' | 'inline' | 'vertical' | Form layout |
| disabled | boolean | false | Disable entire form |
useFormGen
const { fields, form, handleSubmit, isSubmitting, reset } = useFormGen({
schema,
onSubmit,
defaultValues,
})
Field Types
| Type | Rendered Component |
|---|---|
| text, email, password | TextField |
| number | NumberField |
| textarea | TextareaField |
| select, multiselect | SelectField |
| checkbox, switch | CheckboxField |
| date, datetime | DateField |
| array | Array of fields |
| object | Nested fieldset |
Common questions
Things people ask before buying.
Is this compatible with react-hook-form?
Yes — it's built on top of react-hook-form and @hookform/resolvers. You get all the perf benefits and can drop into native RHF APIs when you need to.
Can I use my own field components?
Yes. The `fieldComponents` prop maps field types (text, select, etc.) to your components, and `fieldOverrides` maps by field name for per-field swaps.
What about CSS — does it bring its own?
It ships with Tailwind classes that match shadcn/ui. Override the classes via the `className` prop, or pass your own field components to fully take over.
Can I use it in a commercial product?
Yes. The commercial license lets you use it in unlimited commercial and personal projects. You can't redistribute the source.
£15 — lifetime
One purchase. Yours forever.
Pay once via Stripe. Get the complete package instantly. Free updates for the same major version. Commercial license included.
Secure payment via Stripe · Instant download · 30-day money-back if it doesn't save you time