React Hook Form Logo - React hook custom hook for form validation

Performant, flexible and extensible forms with easy to use 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)

React Hook Form video - React custom hook for form validation

English | 繁中 | 简中 | 日本語 | 한국어 | Français | Italiano | Português | Español | Русский | Deutsch | Türkçe ## Features - Built with performance and DX in mind - Embrace native form validation - Simple integration with [UI libraries](https://codesandbox.io/s/react-hook-form-v6-controller-qsd8r) - [Tiny size](https://bundlephobia.com/result?p=react-hook-form@latest) without any dependency - Follows HTML standard for [validation](https://react-hook-form.com/get-started#Applyvalidation) - [Resolvers](https://github.com/react-hook-form/resolvers) support [Yup](https://github.com/jquense/yup), [Zod](https://github.com/vriad/zod), [Superstruct](https://github.com/ianstormtaylor/superstruct), [Joi](https://github.com/hapijs/joi) or custom ## Install npm install react-hook-form ## Links - [Motivation](https://medium.com/@bruce1049/form-validation-with-hook-in-3kb-c5414edf7d64) - [Video tutorial](https://www.youtube.com/watch?v=-mFXqOaqgZk&t) - [Get started](https://react-hook-form.com/get-started) - [API](https://react-hook-form.com/api) - [Examples](https://github.com/bluebill1049/react-hook-form/tree/master/examples) - [Demo](https://react-hook-form.com) - [Form Builder](https://react-hook-form.com/form-builder) - [FAQs](https://react-hook-form.com/faqs) ## Quickstart ```jsx import React from 'react'; import { useForm } from 'react-hook-form'; function App() { const { register, handleSubmit, errors } = useForm(); // initialize the hook const onSubmit = (data) => { console.log(data); }; return (
{/* register an input */} {errors.lastname && 'Last name is required.'} {errors.age && 'Please enter number for age.'}
); } ``` ## Sponsors Thanks go to these kind and lovely sponsors (company 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)]. ## Organizations Thanks go to these wonderful organizations! [[Contribute](https://opencollective.com/react-hook-form/contribute)]. ## Contributors Thanks go to these wonderful people! [[Become a contributor](CONTRIBUTING.md)].