{"id":13401109,"url":"https://github.com/jquense/react-formal","last_synced_at":"2025-05-14T15:06:16.718Z","repository":{"id":26087926,"uuid":"29531928","full_name":"jquense/react-formal","owner":"jquense","description":"Sophisticated HTML form management for React","archived":false,"fork":false,"pushed_at":"2025-01-15T15:23:09.000Z","size":19223,"stargazers_count":526,"open_issues_count":35,"forks_count":52,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-05-13T10:43:31.448Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://jquense.github.io/react-formal","language":"TypeScript","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/jquense.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"License.txt","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":"2015-01-20T13:49:52.000Z","updated_at":"2025-02-18T21:50:01.000Z","dependencies_parsed_at":"2024-01-13T20:59:29.865Z","dependency_job_id":"a744489d-0b5b-4cde-82d8-b6451ee646d9","html_url":"https://github.com/jquense/react-formal","commit_stats":null,"previous_names":[],"tags_count":155,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jquense%2Freact-formal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jquense%2Freact-formal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jquense%2Freact-formal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jquense%2Freact-formal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jquense","download_url":"https://codeload.github.com/jquense/react-formal/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254169047,"owners_count":22026207,"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":[],"created_at":"2024-07-30T19:00:58.775Z","updated_at":"2025-05-14T15:06:16.654Z","avatar_url":"https://github.com/jquense.png","language":"TypeScript","funding_links":[],"categories":["Uncategorized","TypeScript","React [🔝](#readme)"],"sub_categories":["Uncategorized"],"readme":"# react-formal\n[![npm version](https://img.shields.io/npm/v/react-formal.svg?style=flat-square)](https://www.npmjs.com/package/react-formal)\n\nBetter form validation and value management for React. Provides __minimal__ wiring while also allowing for complete input flexibility.\n\nBuilt on [yup](https://github.com/jquense/yup) and [react-input-message](https://github.com/jquense/react-input-message).\n\n## Install\n\n```sh\nnpm i -S react-formal yup\n```\n\n__(don't like the yup but like how the form works? Try: [topeka](https://github.com/jquense/topeka))__\n\n### Use\n\n__For more complete api documentations, live examples, and getting started guide check out the [documentation site](http://jquense.github.io/react-formal).__\n\n`react-formal` uses a [yup](https://github.com/jquense/yup) schema to update and validate form values. It treats the `form` like an input (representing an object) with a `value` and `onChange`. The `form` can be controlled or uncontrolled as well, just like a normal React input.\n\n```js\nvar yup = require('yup')\n  , Form = require('react-formal')\n\nvar modelSchema = yup.object({\n        name: yup.object({\n            first: yup.string().required('Name is required'),\n            last: yup.string().required('Name is required')\n        }),\n        dateOfBirth: yup.date()\n            .max(new Date(), 'You can be born in the future!')\n    })\n\n// ...in a component\nrender() {\n    return (\n        \u003cForm\n            schema={modelSchema}\n            value={this.state.model}\n            onChange={model =\u003e this.setState({ model })}\n        \u003e\n            \u003cfieldset\u003e\n                \u003clegend\u003ePersonal Details\u003c/legend\u003e\n\n                \u003cForm.Field name='name.first'/\u003e\n                \u003cForm.Message for='name.first'/\u003e\n\n                \u003cForm.Field name='name.last'/\u003e\n                \u003cForm.Message for='name.last'/\u003e\n\n                \u003cForm.Field name='dateOfBirth'/\u003e\n                \u003cForm.Message for='dateOfBirth'/\u003e\n            \u003c/fieldset\u003e\n            \u003cForm.Submit type='submit'\u003eSubmit\u003c/Form.Submit\u003e\n        \u003c/Form\u003e\n    )\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjquense%2Freact-formal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjquense%2Freact-formal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjquense%2Freact-formal/lists"}