All products
React Library

React Form Gen

Ship every form. None of the boilerplate.

Ship your next form in under 5 minutes.
See use cases ↓
One-time paymentLifetime updatesCommercial license

Create your account

Paolo Memoli
paolo@libpro.dev✓ Looks good
············12 chars · strong
Pro — £15/mo
I agree to the terms of service

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.

01

SaaS sign-up & onboarding

Multi-step wizard with conditional fields. Plan choice, team size, payment — different paths per choice.

Ship onboarding in a day, not a sprint.
02

Checkout & payment forms

Address, billing, review — with server-side validation that matches your Zod schema byte for byte.

Cut checkout drop-off with proper a11y.
03

Admin panels & CMS

Create/edit screens for any resource. Type-safe, validated, with the same UX across every entity.

One form component, every CRUD screen.
04

Settings & preferences

Show/hide fields based on the user's plan. Override the password field with your auth UI. Keep the validation.

Settings pages that scale with the product.

Built for

If any of these are you, this is for you.

Frontend engineers shipping fastIndie hackers & solo foundersDesign engineers who want their own component slotsTeams standardising on Zod
Built withReact 18+TypeScriptZodTailwind CSS

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.

terminal
$npm install react-form-gen zod react-hook-form @hookform/resolvers
$# Drop in. Add your schema. Done.
$npm run dev
$# First form in 5 minutes

What's in the box

  • FormGen component
    the main entry point
  • useFormGen hook
    for custom layouts
  • 8 field components
    text, number, date, select, etc.
  • Wizard layout
    multi-step, optional
  • Conditional fields
    show/hide by value
  • TypeScript types
    fully exported
  • Tailwind theme tokens
    override anything
  • Full source + docs
    no obfuscation

Full feature list

What makes this a real product, not a weekend hack.

Zod schema → type-safe form in one line
Built-in validation with error states
Multi-step wizard mode
Conditional fields (show/hide based on values)
Custom component slots
Shadcn/ui & Tailwind styled — easy to customize
Dark mode support
Full TypeScript types exported

Works with

Tested against the React stack you already use.

React 18+
peer dep
Zod 3+
schema source
react-hook-form
peer dep
Vite / Next.js / Remix
tested
Shadcn/ui themes
drop-in
Tailwind CSS
styling

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

PropTypeDefaultDescription
schemaZodTyperequiredThe Zod schema to generate the form from
onSubmit(data: T) => voidrequiredCalled with validated data
defaultValuesPartial<T>Initial form values
classNamestring''CSS class on the form element
fieldComponentsRecord<FieldType, Component>Override renders per field type
fieldOverridesRecord<string, Component>Override renders per field name
submitLabelstring'Submit'Submit button text
showResetbooleanfalseShow reset button
hideLabelsbooleanfalseHide field labels
layout'vertical' | 'horizontal' | 'inline''vertical'Form layout
disabledbooleanfalseDisable entire form

useFormGen

const { fields, form, handleSubmit, isSubmitting, reset } = useFormGen({
  schema,
  onSubmit,
  defaultValues,
})

Field Types

TypeRendered Component
text, email, passwordTextField
numberNumberField
textareaTextareaField
select, multiselectSelectField
checkbox, switchCheckboxField
date, datetimeDateField
arrayArray of fields
objectNested 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