React Hook Form Logo - React hook custom hook for form validation
https://user-images.githubusercontent.com/10513364/152621466-59a41c65-52b4-4518-9d79-ffa3fafa498a.mp4
[![npm downloads](https://img.shields.io/npm/dm/react-hook-form.svg?style=for-the-badge)](https://www.npmjs.com/package/react-hook-form) [![npm](https://img.shields.io/npm/dt/react-hook-form.svg?style=for-the-badge)](https://www.npmjs.com/package/react-hook-form) [![npm](https://img.shields.io/npm/l/react-hook-form?style=for-the-badge)](https://github.com/react-hook-form/react-hook-form/blob/master/LICENSE) [![Discord](https://img.shields.io/discord/754891658327359538.svg?style=for-the-badge&label=&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2)](https://discord.gg/yYv7GZ8)

Get started | API | Examples | Demo | Form Builder | FAQs

### Features - Built with performance, UX and DX in mind - Embraces native HTML form [validation](https://react-hook-form.com/get-started#Applyvalidation) - Out of the box integration with [UI libraries](https://codesandbox.io/s/react-hook-form-v7-controller-5h1q5) - [Small size](https://bundlephobia.com/result?p=react-hook-form@latest) and no [dependencies](./package.json) - Support [Yup](https://github.com/jquense/yup), [Zod](https://github.com/vriad/zod), [AJV](https://github.com/ajv-validator/ajv), [Superstruct](https://github.com/ianstormtaylor/superstruct), [Joi](https://github.com/hapijs/joi), [Vest](https://github.com/ealush/vest), [class-validator](https://github.com/typestack/class-validator), [io-ts](https://github.com/gcanti/io-ts), [nope](https://github.com/bvego/nope-validator) and custom build ### Install npm install react-hook-form ### Quickstart ```jsx import React from 'react'; import { useForm } from 'react-hook-form'; function App() { const { register, handleSubmit, formState: { errors }, } = useForm(); const onSubmit = (data) => console.log(data); return (
{errors.lastName &&

Last name is required.

} {errors.age &&

Please enter number for age.

}
); } ``` ### Sponsors Thanks go to these kind and lovely sponsors (companies and individuals)!

@sayav @lemcii @washingtonsoares @lixunn @SamSamskies @peaonunes @wilhelmeek @iwarner @joejknowles @chris-gunawardena @Tymek @Luchanso @vcarel @gragland @tjshipe @krnlde @msutkowski @mlukaszczyk

### Backers Thanks go to all our backers! [[Become a backer](https://opencollective.com/react-hook-form#backer)]. ### Contributors Thanks go to these wonderful people! [[Become a contributor](CONTRIBUTING.md)]. ### Helpers Thank you for helping and answering questions from the community. ### Organizations Thanks go to these wonderful organizations! [[Contribute](https://opencollective.com/react-hook-form/contribute)].