Skip to content
Gelatin UIAlpha

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

Read https://gelatinui.com/docs/forms.md. Find the form library in this project's package.json, then open the matching guide and follow it. Done: each form uses Gelatin UI Field parts, and each error shows under its field.

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, then FieldError.
  • 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