Build forms
Use your form library for values and checks. Our Field parts show the label, the help text, and the error.
Forms · step 1 of 3 · 2 min read
Prompt for your agent
Your agent reads /docs/forms.md: the same text as this page, as Markdown.
You keep your form library. It owns the values and the checks. Our Field parts show the label, the help text, and the error of each field.
Pick a guide
Each guide builds the same forms with one library. Use the guide of the library that your project already has.
- Use TanStack Form: type-safe forms. Each field checks on its own, and the form waits for async checks.
- Use React Hook Form: small, fast forms. A resolver checks the full form with your schema.
What each guide holds
The two guides have the same sections, so you can compare them side by side.
- Anatomy. The library's field, then
Field, thenFieldError. - Build a form. A full form with a schema and a server check.
- Control types. Input, Select, Combobox, Date Picker, OTP, and more.
- Server errors. An error from the server shows under its field.
- Busy submit. The Button waits while the request runs.
- Arrays. Add and remove rows of fields.
- Traps. Mistakes that our own forms made, each with its fix.
Forms with no library
A short form may need no library. Form and Field check fields on their own: required, type, minLength, and a validate function. Form also takes the errors of the server, by field name.
Next steps
- Use TanStack Form: build a form with TanStack Form.
- Use React Hook Form: build a form with React Hook Form.
- Form: checks, server errors, and validation modes, with no form library.