A 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.
Check out the live demo of the Form Builder here.
To get started with Form Builder, follow these steps:
Clone the repository:
bash
git clone https://github.com/hasanharman/form-builder.git
Navigate into the project directory:
bash
cd form-builder
Install the necessary dependencies:
bash
npm install
To start the development server, run:
npm run dev
Open your browser and navigate to http://localhost:3000 to see the application in action.
Form Builder consists of various reusable components:
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:
bash
git checkout -b feature/YourFeatureNamebash
git commit -m "Add a feature"bash
git push origin feature/YourFeatureNameThis 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:
shadcnstudio.com - Explore beautiful shadcn blocks & templates to accelerate your development.
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:
| tino-technology | feliperails | Radu Ciocan | rutsatz | Maxim Ciebiera |
Your support helps keep this project alive and thriving! Become a sponsor on GitHub and help shape the future of form building.
$ claude mcp add form-builder \
-- python -m otcore.mcp_server <graph>