React Hook Form Logo - React hook custom hook for form validation
[![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 | Form Builder | FAQs | Examples

### 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/colinhacks/zod), [AJV](https://github.com/ajv-validator/ajv), [Superstruct](https://github.com/ianstormtaylor/superstruct), [Joi](https://github.com/hapijs/joi) and [others](https://github.com/react-hook-form/resolvers) ### Install npm install react-hook-form ### Quickstart ```jsx import { useForm } from 'react-hook-form'; function App() { const { register, handleSubmit, formState: { errors }, } = useForm(); return (
console.log(data))}> {errors.lastName &&

Last name is required.

} {errors.age &&

Please enter number for age.

}
); } ``` ### Sponsors Thanks go to these kind and lovely sponsors! ### Past sponsors ### 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)].