Headless, performant, and type-safe form state management for TS/JS, React, Vue, Angular, Solid, and Lit
open sourceMITself-hostablefree
TanStack Form is a headless, framework-agnostic form state library with adapters for React, Vue, Angular, Solid, Svelte and Lit: you bring your own inputs, and it tracks values, touched and dirty state, errors and submission, with field names and values typed end to end in TypeScript. Validation runs per field or for the whole form, on change, blur or submit, with async validators and built-in debouncing, and it accepts any Standard Schema library (Zod, Valibot, ArkType, Effect Schema) without an adapter. Array fields, subscriptions to slices of form state and server validation from onSubmitAsync are built in, and its docs cover TanStack Start, Next.js App Router server actions and Remix. It reached 1.0 in March 2025 and is MIT licensed.
Problems it solves
- use the same form logic in React, Vue, Angular, Solid, Svelte or Lit apps
- a typo in a field name should fail to compile instead of silently doing nothing
- check whether a username is available while the user types, without a request on every keystroke
- validate some fields on blur, others on change, and everything again on submit
- send the whole form to one API endpoint on submit and show the errors it returns next to each field
- plug a Valibot or ArkType schema into my form without an adapter package
- handle a form with Next.js server actions and keep its errors in client state
- keep form state in sync with Remix actions or TanStack Start server functions
- re-render only the submit button when the form's validity changes
- keep my own input components and get form state and validation from a headless library
- edit a list of nested objects in a form with typed paths like people[0].name
- inspect form values and errors in devtools while I build a form
Features
- adapters for React, Vue, Angular, Solid, Svelte and Lit over a framework-agnostic core
- fully typed field names and values
- field-level and form-level validation on change, blur, submit and more
- async validators with debouncing (asyncDebounceMs, onChangeAsyncDebounceMs)
- native support for Standard Schema libraries: Zod, Valibot, ArkType, Effect Schema
- array fields (mode="array", pushValue and other helpers) and nested subfields
- Subscribe component and selectors to re-render on slices of form state
- server validation from the form's onSubmitAsync, mapped to fields
- guides for TanStack Start, Next.js App Router and Remix
- devtools plugin for TanStack Devtools
Limitations
- Doesn't support TypeScript versions before 5.4: its types need TypeScript 5.4 or later with strict mode1
Alternatives
The same job
These do what TanStack Form does.
- React Hook Form Performant, flexible and extensible forms with easy-to-use validation
