{"id":22327193,"url":"https://github.com/vanbui1995/dynamic-form","last_synced_at":"2025-12-30T22:48:33.209Z","repository":{"id":263938515,"uuid":"891286262","full_name":"vanbui1995/dynamic-form","owner":"vanbui1995","description":"This repository demonstrates how to build dynamic forms powered by API data using modern tools like Vite, React, React Hook Form, and Zod","archived":false,"fork":false,"pushed_at":"2025-01-15T15:46:16.000Z","size":90,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-31T07:44:52.606Z","etag":null,"topics":["dynamic-field","dynamic-form","dynamic-forms","dynamic-inputs","dynamic-validation","example","react-hook-form","reactjs","remote-form","validation","zod"],"latest_commit_sha":null,"homepage":"https://dynamic-form-steven.netlify.app/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vanbui1995.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-20T04:00:36.000Z","updated_at":"2025-01-15T15:46:18.000Z","dependencies_parsed_at":"2025-01-15T17:38:48.572Z","dependency_job_id":"60dad069-7d69-41dc-bf57-b70399e3505a","html_url":"https://github.com/vanbui1995/dynamic-form","commit_stats":null,"previous_names":["vanbui1995/dynamic-form"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanbui1995%2Fdynamic-form","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanbui1995%2Fdynamic-form/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanbui1995%2Fdynamic-form/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanbui1995%2Fdynamic-form/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vanbui1995","download_url":"https://codeload.github.com/vanbui1995/dynamic-form/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245599346,"owners_count":20642085,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dynamic-field","dynamic-form","dynamic-forms","dynamic-inputs","dynamic-validation","example","react-hook-form","reactjs","remote-form","validation","zod"],"created_at":"2024-12-04T03:08:41.015Z","updated_at":"2025-12-30T22:48:33.180Z","avatar_url":"https://github.com/vanbui1995.png","language":"TypeScript","readme":"\n# Dynamic Forms Example Remote API, React Hook Form, and Zod\n\nThis repository demonstrates how to build dynamic forms powered by API data using modern tools like **Vite**, **React**, **React Hook Form**, and **Zod**. The example is designed to complement the blog post: [How we build Dynamic Forms in Admina Migration](https://mfi.engineering/how-we-build-dynamic-form-in-admina-migration-0576d97a036b).\n\n![2024-11-21_11-36-21-ezgif com-video-to-gif-converter](https://github.com/user-attachments/assets/46f667b9-e5b1-4e1c-aa43-3bfa8b7839b1)\n\n\nLive Demo: https://dynamic-form-steven.netlify.app/\n\n## Features\n\n- **Dynamic Form Rendering**: Fields are generated dynamically based on API responses includes (input types, input options, validation, initial values...)\n- **Custom API Board**: Simulate update fields and field options in your backend database and affect immediately to the current form\n- **Validation with Zod**: Leverage schema-based validation for better type safety and error handling\n- **React Hook Form**: Manage form state efficiently and integrate with validation seamlessly.\n\n\n## Getting Started\n\n### Prerequisites\n- Node.js (\u003e= 16.x)\n- Yarn (\u003e= 1.x)\n\n### Installation\n\n1. Clone the repository:\n   ```bash\n   git clone https://github.com/vanbui1995/dynamic-form.git\n   cd dynamic-form\n   ```\n\n2. Install dependencies:\n   ```bash\n   yarn install\n   ```\n\n3. Start the development server:\n   ```bash\n   yarn dev\n   ```\n\n4. Open your browser and navigate to `http://localhost:3000` to view the app.\n\n## Project Structure\n\n```\n├── public/         # Static assets\n├── src/\n│   ├── components/ # Reusable components\n│   ├── hooks/      # Custom React hooks\n│   ├── utils/      # Utility functions\n│   ├── App.tsx     # Main application entry point\n│   └── main.tsx    # Vite entry point\n├── vite.config.ts  # Vite configuration\n├── package.json    # Project dependencies\n└── README.md       # Project documentation\n```\n\n## How It Works\n\n1. **Fetch Form Configuration**: Fetches field configurations dynamically from an API endpoint.\n2. **Render Fields**: Maps the configuration into React components like text inputs, selects, checkboxes, etc.\n3. **Validation**: Validates user input with Zod schemas associated with each field.\n4. **Submit Data**: Submits the form data back to the API after validation passes.\n\n## References\n\n- Blog: [How we build Dynamic Forms in Admina Migration](https://www.notion.so/mfi/How-we-build-Dynamic-Forms-in-Admina-Migration-1439b9c183cb805c83b2e47d68192e09)\n- [React Hook Form Documentation](https://react-hook-form.com/)\n- [Zod Documentation](https://zod.dev/)\n- [Vite Documentation](https://vitejs.dev/)\n\n## Contribution\n\nFeel free to fork this repository and create a pull request with improvements or additional features. Feedback is always welcome!\n\n## License\n\nThis project is licensed under the MIT License. See the `LICENSE` file for details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvanbui1995%2Fdynamic-form","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvanbui1995%2Fdynamic-form","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvanbui1995%2Fdynamic-form/lists"}