{"id":48185691,"url":"https://github.com/zhyd1997/use-form-hooks","last_synced_at":"2026-04-04T17:48:46.821Z","repository":{"id":40671289,"uuid":"412492476","full_name":"zhyd1997/use-form-hooks","owner":"zhyd1997","description":"useForm hooks for controlled components.","archived":false,"fork":false,"pushed_at":"2023-01-07T13:38:00.000Z","size":3095,"stargazers_count":0,"open_issues_count":15,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-11T08:28:04.642Z","etag":null,"topics":["form","form-validation","forms","hacktoberfest","react","react-hooks"],"latest_commit_sha":null,"homepage":"","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/zhyd1997.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":null,"patreon":"user?u=62512516","open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":"https://paypal.me/zhyd1997?locale.x=zh_XC"}},"created_at":"2021-10-01T14:10:07.000Z","updated_at":"2022-01-29T12:28:51.000Z","dependencies_parsed_at":"2023-02-07T07:43:09.766Z","dependency_job_id":null,"html_url":"https://github.com/zhyd1997/use-form-hooks","commit_stats":null,"previous_names":["zhyd1997/useform"],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/zhyd1997/use-form-hooks","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhyd1997%2Fuse-form-hooks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhyd1997%2Fuse-form-hooks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhyd1997%2Fuse-form-hooks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhyd1997%2Fuse-form-hooks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zhyd1997","download_url":"https://codeload.github.com/zhyd1997/use-form-hooks/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhyd1997%2Fuse-form-hooks/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31407654,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T10:20:44.708Z","status":"ssl_error","status_checked_at":"2026-04-04T10:20:06.846Z","response_time":60,"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-validation","forms","hacktoberfest","react","react-hooks"],"created_at":"2026-04-04T17:48:44.811Z","updated_at":"2026-04-04T17:48:46.814Z","avatar_url":"https://github.com/zhyd1997.png","language":"TypeScript","funding_links":["https://patreon.com/user?u=62512516","https://paypal.me/zhyd1997?locale.x=zh_XC"],"categories":[],"sub_categories":[],"readme":"[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n![NPM](https://img.shields.io/npm/l/@zhyd1997/use-form-hooks)\n![npm (scoped)](https://img.shields.io/npm/v/@zhyd1997/use-form-hooks)\n[![codecov](https://codecov.io/gh/zhyd1997/useForm/branch/main/graph/badge.svg?token=8VLNN86IK0)](https://codecov.io/gh/zhyd1997/useForm)\n\n![npm](https://img.shields.io/npm/dw/@zhyd1997/use-form-hooks?style=for-the-badge)\n![npm](https://img.shields.io/npm/dm/@zhyd1997/use-form-hooks?style=for-the-badge)\n![npm](https://img.shields.io/npm/dt/@zhyd1997/use-form-hooks?style=for-the-badge)\n\n\u003e Design useForm hooks and related components.\n\nDemo: [CodeSandbox](https://codesandbox.io/s/blissful-browser-fop66?file=/src/components/BusinessForm.tsx)\n\n# Features\n\n- Support 4 types of input elements: `text`, `email`, `password` and `select`;\n- Controlled Components;\n- Validate form using [Constraint Validation API](https://developer.mozilla.org/en-US/docs/Web/API/Constraint_validation).\n\n# Install\n\n```bash\n  # using npm\n  npm install @zhyd1997/use-form-hooks\n  # or using yarn\n  yarn add @zhyd1997/use-form-hooks\n```\n\n# Usage\n\n```jsx\nimport React from \"react\";\nimport { useForm, Form, Select, TextField } from \"@zhyd1997/use-form-hooks\";\nimport type { SelectProps, TextFieldProps } from \"@zhyd1997/use-form-hooks\";\n\nfunction MyForm() {\n  const { values, errors, onChange, handleSubmit } = useForm\u003cInitialFormState\u003e({\n    username: \"\",\n    email: \"\",\n    role: \"\",\n    password: \"\"\n  });\n\n  const onSubmit = () =\u003e {\n    alert(JSON.stringify(values));\n  };\n\n  return (\n    \u003cdiv\u003e\n      \u003cForm onSubmit={handleSubmit(onSubmit)}\u003e\n        \u003cTextField {...formState.username} onChange={onChange} /\u003e\n        \u003cTextField {...formState.email} onChange={onChange} /\u003e\n        \u003cSelect {...formState.select} onChange={onChange} /\u003e\n        \u003cTextField {...formState.password} onChange={onChange} /\u003e\n        \u003cbutton type=\"submit\" className=\"cta-button\"\u003e\n          Submit\n        \u003c/button\u003e\n      \u003c/Form\u003e\n    \u003c/div\u003e\n  );\n}\n```\n\n# Development\nWhen publishing a new release, you must at most do the 2 things below:\n\n1. update `version` field in `package.json`.\n2. update the version of package used in `examples`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhyd1997%2Fuse-form-hooks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzhyd1997%2Fuse-form-hooks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhyd1997%2Fuse-form-hooks/lists"}