A dynamic form-building tool that allows users to create, customize, and validate forms seamlessly within web applications.
See the codeA dynamic form-building tool that allows users to create, customize, and validate forms seamlessly within web applications. Built with React, Next.js, and various other technologies, Form Builder provides an intuitive interface for developers and users alike.
shadcn add command it needs.Check out the live demo of the Form Builder here.
To get started with Form Builder, follow these steps:
Clone the repository:
git clone https://github.com/hasanharman/form-builder.git
Navigate into the project directory:
cd form-builder
Install the necessary dependencies:
pnpm install
To start the development server, run:
pnpm dev
pnpm dev and pnpm build first build the registry into public/r. Run the tests with pnpm test.
Open your browser and navigate to http://localhost:3000 to see the application in action.
The site's UI is shadcn/ui on Base UI (components.json style base-vega). The extra form components (phone input, multi select, credit card, signature pad, …) are documented at /components.
Everything under /components and /templates is published as a shadcn registry. Install an item with the shadcn CLI:
npx shadcn@latest add https://www.shadcn-form.com/r/phone-input.json
Items only use props every shadcn style shares, so they install into Radix (radix-*, new-york) and Base UI (base-*) projects alike. The generated form code in the playground starts with the command that installs everything it imports.
registry.json is the source of truth: titles, descriptions, files, dependencies.pnpm registry:build runs shadcn build into public/r; pnpm registry:validate checks the source.__tests__/registry-catalog.spec.ts checks each item's declared dependencies against its imports.Domain terms are defined in CONTEXT.md.
components/field-variants/: one module per playground field type (preview control, validation, default value, generated code). Add a field type by adding a module and listing it in index.ts.lib/form-code/: the form code generator, with one adapter per form library.lib/registry-catalog.ts: reads registry.json for docs pages, sidebars and install commands.components/ui/: shadcn wrappers; the only place allowed to import @base-ui/react.Form Builder utilizes Zod for input validation. You can define schemas for your forms as follows:
import { z } from 'zod';
const formSchema = z.object({
name: z.string().min(1, "Name is required"),
email: z.string().email("Invalid email address"),
age: z.number().min(18, "You must be at least 18 years old"),
});
This schema can be applied to your form to enforce validation rules.
Once your form is ready, you can handle submissions with a simple API call. Here’s an example of how to submit the form data:
const handleSubmit = async (data) => {
try {
const response = await fetch('/api/form-submit', {
method: 'POST',
body: JSON.stringify(data),
headers: {
'Content-Type': 'application/json',
},
});
const result = await response.json();
console.log('Form submitted successfully:', result);
} catch (error) {
console.error('Error submitting form:', error);
}
};
Contributions are welcome! If you would like to contribute to Form Builder, please follow these steps:
git checkout -b feature/YourFeatureName
git commit -m "Add a feature"
git push origin feature/YourFeatureName
This project is licensed under the MIT License.
A huge thank you to everyone who has supported this project! Your generosity keeps this project alive and growing. I truly appreciate every single one of you.
Premium sponsors featured prominently throughout the project:
These wonderful folks help drive the project forward:
Thank you for being part of this journey:
A heartfelt thanks to those who previously supported the project:
Your support helps keep this project alive and thriving! Become a sponsor on GitHub and help shape the future of form building.
136 followers · starred May 2025
92 followers · starred Sep 2024
25 followers · starred Nov 2024
430 followers · starred May 2026
A dynamic form-building tool that allows users to create, customize, and validate forms seamlessly within web applications.
See the codeA dynamic form-building tool that allows users to create, customize, and validate forms seamlessly within web applications. Built with React, Next.js, and various other technologies, Form Builder provides an intuitive interface for developers and users alike.
shadcn add command it needs.Check out the live demo of the Form Builder here.
To get started with Form Builder, follow these steps:
Clone the repository:
git clone https://github.com/hasanharman/form-builder.git
Navigate into the project directory:
cd form-builder
Install the necessary dependencies:
pnpm install
To start the development server, run:
pnpm dev
pnpm dev and pnpm build first build the registry into public/r. Run the tests with pnpm test.
Open your browser and navigate to http://localhost:3000 to see the application in action.
The site's UI is shadcn/ui on Base UI (components.json style base-vega). The extra form components (phone input, multi select, credit card, signature pad, …) are documented at /components.
Everything under /components and /templates is published as a shadcn registry. Install an item with the shadcn CLI:
npx shadcn@latest add https://www.shadcn-form.com/r/phone-input.json
Items only use props every shadcn style shares, so they install into Radix (radix-*, new-york) and Base UI (base-*) projects alike. The generated form code in the playground starts with the command that installs everything it imports.
registry.json is the source of truth: titles, descriptions, files, dependencies.pnpm registry:build runs shadcn build into public/r; pnpm registry:validate checks the source.__tests__/registry-catalog.spec.ts checks each item's declared dependencies against its imports.Domain terms are defined in CONTEXT.md.
components/field-variants/: one module per playground field type (preview control, validation, default value, generated code). Add a field type by adding a module and listing it in index.ts.lib/form-code/: the form code generator, with one adapter per form library.lib/registry-catalog.ts: reads registry.json for docs pages, sidebars and install commands.components/ui/: shadcn wrappers; the only place allowed to import @base-ui/react.Form Builder utilizes Zod for input validation. You can define schemas for your forms as follows:
import { z } from 'zod';
const formSchema = z.object({
name: z.string().min(1, "Name is required"),
email: z.string().email("Invalid email address"),
age: z.number().min(18, "You must be at least 18 years old"),
});
This schema can be applied to your form to enforce validation rules.
Once your form is ready, you can handle submissions with a simple API call. Here’s an example of how to submit the form data:
const handleSubmit = async (data) => {
try {
const response = await fetch('/api/form-submit', {
method: 'POST',
body: JSON.stringify(data),
headers: {
'Content-Type': 'application/json',
},
});
const result = await response.json();
console.log('Form submitted successfully:', result);
} catch (error) {
console.error('Error submitting form:', error);
}
};
Contributions are welcome! If you would like to contribute to Form Builder, please follow these steps:
git checkout -b feature/YourFeatureName
git commit -m "Add a feature"
git push origin feature/YourFeatureName
This project is licensed under the MIT License.
A huge thank you to everyone who has supported this project! Your generosity keeps this project alive and growing. I truly appreciate every single one of you.
Premium sponsors featured prominently throughout the project:
These wonderful folks help drive the project forward:
Thank you for being part of this journey:
A heartfelt thanks to those who previously supported the project:
Your support helps keep this project alive and thriving! Become a sponsor on GitHub and help shape the future of form building.
136 followers · starred May 2025
92 followers · starred Sep 2024
25 followers · starred Nov 2024
430 followers · starred May 2026