106 captures
16 Oct 2019 - 01 Nov 2025
Jan FEB Mar
15
2021 2022 2023
success
fail

About this capture

COLLECTED BY

Collection: Save Page Now

TIMESTAMPS

The Wayback Machine - http://web.archive.org/web/20220215225833/https://www.react-hook-form.com/form-builder
 
Skip to content

Home
Get Started
API
TS
TS
Advanced
FAQsTools 
DevToolsForm Builder

DevTools
Form Builder
ResourcesReleases
More

Builder

Build your form with code and example.

Layout

!You can start adding fields with Input Creator.
First name

Last name

Email

Mobile number

Title

Developer


Input Creator

!This form allows you to create and update inputs. The Generate Form button will create a new form with the updates.

or

Code

!As you are making changes over the form, the code section will be updated and you can copy the code as well.




import React from 'react';
import { useForm } from 'react-hook-form';

export default function App() {
  const { register, handleSubmit, formState: { errors } } = useForm();
  const onSubmit = data => console.log(data);
  console.log(errors);
  
  return (
    <form onSubmit={handleSubmit(onSubmit)}>
      <input type="text" placeholder="First name" {...register("First name", {required: true, maxLength: 80})} />
      <input type="text" placeholder="Last name" {...register("Last name", {required: true, maxLength: 100})} />
      <input type="text" placeholder="Email" {...register("Email", {required: true, pattern: /^\S+@\S+$/i})} />
      <input type="tel" placeholder="Mobile number" {...register("Mobile number", {required: true, minLength: 6, maxLength: 12})} />
      <select {...register("Title", { required: true })}>
        <option value="Mr">Mr</option>
        <option value="Mrs">Mrs</option>
        <option value="Miss">Miss</option>
        <option value="Dr">Dr</option>
      </select>

      <input {...register("Developer", { required: true })} type="radio" value="Yes" />
      <input {...register("Developer", { required: true })} type="radio" value="No" />

      <input type="submit" />
    </form>
  );
}

Want to learn more?

Check out the React Hook Form documentation and learn all about the API.


Home
Get Started
API
TS
Advanced
FAQs
Form Builder
DevTools
Resources
About us
Designed and Built by @Bill Luo = React Simple Animate  Little State Machine
Please support us by leaving a  @github | Feedback
Hosted on  Vercel Now
Edit