Type-safe forms with React Hook Form + Zod

Reusable form components. Built for developers.

A CLI for generating type-safe, reusable form components using React Hook Form, Zod, Tailwind CSS, and shadcn/ui.

npm installapp-form

Simple and Powerful

Define your schema with Zod, generate type-safe forms in seconds.

tsx

const SimpleForm = () => {
  const onSubmit = (data: THomeCode) => {
    console.log(data);
  };

  return (
    <div className="max-w-xl m-auto">
      <AppForm<TFullName>
        schema={fullNameSchema}
        onSubmit={onSubmit}
        className="px-6 pb-6 space-y-4"
      >
        {({ register, formState: { errors } }) => (
          <>
            <AppInputField
              name="fullName"
              type="text"
              register={register}
              errors={errors}
            />
            <Button type="submit" className="w-full">
              Submit
            </Button>
          </>
        )}
      </AppForm>
    </div>
  );
};

export default SimpleForm;

Everything you need to build forms fast

Built with developer experience in mind. Install only what you need, when you need it.

React Hook Form + Zod

Built on industry-standard libraries for type-safe validation and optimal performance.

Reusable Components

Input, Select, Checkbox, File Upload and more. Each component is fully customizable.

Smart CLI

Install components one-by-one (shadcn-style) or all at once. Your choice.

Dependency Aware

Automatically installs internal dependencies and warns about required packages.

Full TypeScript

Complete type safety from schema to form submission. Catch errors at compile time.

Next.js Ready

Works seamlessly with Next.js App Router with "use client" support out of the box.

Get started in seconds

Install the CLI and start generating form components.

1

Install the package

$ npm install app-form
2

List available components

$ npx app-form list

app-form

app-input-field

app-checkbox

app-select-item

app-file-uploader

app-input-field-array

3

Add components as needed

$ npx app-form add app-input-field

Or install everything at once with npx app-form init

4

Peer Dependencies

$ npm install react-hook-form zod @hookform/resolvers class-variance-authority

You must already have these installed in your app

5

ShadcnUI components

$ npx shadcn@latest add input label checkbox select

And make sure shadcn/ui components (like input, label, etc.) are generated if you want to use the app-form's components