{"id":23362986,"url":"https://github.com/fetchforms/fetch-forms-react","last_synced_at":"2026-03-04T14:32:08.608Z","repository":{"id":119577943,"uuid":"427089704","full_name":"fetchforms/fetch-forms-react","owner":"fetchforms","description":"The react client for Fetch Forms","archived":false,"fork":false,"pushed_at":"2022-03-07T23:23:20.000Z","size":1518,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-21T07:56:47.775Z","etag":null,"topics":["form","form-builder","form-validation","forms","react"],"latest_commit_sha":null,"homepage":"https://fetchforms.io","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fetchforms.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2021-11-11T17:39:19.000Z","updated_at":"2022-10-28T01:12:56.000Z","dependencies_parsed_at":"2023-03-13T12:39:53.229Z","dependency_job_id":null,"html_url":"https://github.com/fetchforms/fetch-forms-react","commit_stats":null,"previous_names":["fetchforms/react-client"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/fetchforms/fetch-forms-react","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fetchforms%2Ffetch-forms-react","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fetchforms%2Ffetch-forms-react/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fetchforms%2Ffetch-forms-react/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fetchforms%2Ffetch-forms-react/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fetchforms","download_url":"https://codeload.github.com/fetchforms/fetch-forms-react/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fetchforms%2Ffetch-forms-react/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30083759,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T13:22:36.021Z","status":"ssl_error","status_checked_at":"2026-03-04T13:20:45.750Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["form","form-builder","form-validation","forms","react"],"created_at":"2024-12-21T12:34:21.378Z","updated_at":"2026-03-04T14:32:08.571Z","avatar_url":"https://github.com/fetchforms.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fetch Forms for React\n\n### What is Fetch Forms?\nFetch Forms is a headless forms builder designed to help developers build forms and connect data.\n\n## Documentation\n- [Full code examples](https://github.com/fetchforms/react-example-app)\n- [Doc Overview](https://www.fetchforms.io/docs/overview)\n- [The Fetch Form object](https://www.fetchforms.io/docs/fetch-form-object)\n- [Storing forms in source code](www.fetchforms.io/docs/source-code-forms)\n\n### Add the package to your app\n```sh\nnpm install @fetchforms/react\n```\n```sh\nyarn add @fetchforms/react\n```\n\n### Quick start\nUsing the `\u003cFetchForm /\u003e` component is the fastest way to see Fetch Forms in action. This component will handle client-side validation, data parsing, and saving to the cloud if your form has `cloudSave` set. \n\n```jsx\nimport { FetchForm } from \"@fetchforms/react\";\n\nconst MyFetchForm = () =\u003e {\n    const onSubmit = async (values) =\u003e {\n        console.log('values', values);\n    };\n    const onLoad = async (values) =\u003e {\n        console.log('values', values);\n    };\n\n    return (\n        \u003cFetchForm\n            slug=\"FORM_SLUG\"\n            onSubmit={onSubmit}\n            onLoad={onLoad}\n        /\u003e\n    );\n};\n```\n\n### Using hooks\nThe `useFetchForms` hook allows you to display your forms in more complex layouts. See the [custom form example](https://github.com/fetchforms/react-example-app/tree/main/src/examples) to see an implementation using Ant.Design form element.\n\n```jsx\nimport { useFetchForms } from \"@fetchforms/react\";\n\nconst CustomFormLayout = () =\u003e {\n    const [fetchForm, loading, error] = useFetchForms('FORM_SLUG');\n\n    const onFinish = (values) =\u003e {\n        console.log('values', values);\n        // To show an error on the form, return a message as a string.\n    };\n\n    return (\n        \u003c\u003e\n            {error \u0026\u0026 \u003cdiv\u003eError: {error}\u003c/div\u003e}\n            {loading ? (\n                \u003cdiv\u003eLoading...\u003c/div\u003e\n            ) : (\n                fetchForm \u0026\u0026 (\n                    \u003cform\n                        name='customForm'\n                        onSubmit={onFinish}\n                    \u003e\n                        {fetchForm.formItems.map((item, i) =\u003e {\n                            if(item.fieldType === 'select') {\n                                return (\n                                    \u003cdiv key={item.fieldHtml.id}\u003e\n                                        \u003clabel for={item.fieldHtml.name}\u003e{item.label}\u003c/label\u003e\n                                        \u003cselect {...item.fieldHtml}\u003e\n                                            {item.options.map((opt) =\u003e (\n                                                \u003coption value={opt.value} key={opt.value}\u003e{opt.label}\u003c/option\u003e\n                                            ))}\n                                        \u003c/select\u003e\n                                    \u003c/div\u003e\n                                );\n                            } else if (item.fieldType === 'checkbox') {\n                                return (\n                                    \u003cdiv key={item.fieldHtml.id}\u003e\n                                        \u003cinput {...item.fieldHtml} /\u003e\n                                        \u003clabel for={item.fieldHtml.name}\u003e{item.label}\u003c/label\u003e\n                                    \u003c/div\u003e\n                                );\n                            {/* ...other field types */}\n                            } else {\n                                return (\n                                    \u003cdiv key={item.fieldHtml.id}\u003e\n                                        \u003cinput {...item.fieldHtml} /\u003e\n                                        \u003clabel for={item.fieldHtml.name}\u003e{item.label}\u003c/label\u003e\n                                    \u003c/div\u003e\n                                );\n                            }\n                        })}\n                        \u003cbutton type='submit'\u003e\n                            {fetchForm.submitText}\n                        \u003c/button\u003e\n                    \u003c/form\u003e\n                )\n            )}\n      \u003c/\u003e\n    )\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffetchforms%2Ffetch-forms-react","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffetchforms%2Ffetch-forms-react","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffetchforms%2Ffetch-forms-react/lists"}