--- id: quick-start title: Quick Start --- TanStack Form is unlike most form libraries you've used before. It's designed for large-scale production usage, with a focus on type safety, performance and composition for an unmatched developer experience. As a result, we've developed [a philosophy around the library's usage](../../philosophy.md) that values scalability and long-term developer experience over short and sharable code snippets. Here's an example of a form following many of our best practices, which will allow you to rapidly develop even high-complexity forms after a short onboarding experience: ```tsx import React from 'react' import ReactDOM from 'react-dom/client' import { createFormHook, createFormHookContexts } from '@tanstack/react-form' // Form components that pre-bind events from the form hook; check our "Form Composition" guide for more import { TextField, NumberField, SubmitButton } from '~our-app/ui-library' // We also support Valibot, ArkType, and any other standard schema library import { z } from 'zod' const { fieldContext, formContext } = createFormHookContexts() // Allow us to bind components to the form to keep type safety but reduce production boilerplate // Define this once to have a generator of consistent form instances throughout your app const { useAppForm } = createFormHook({ fieldComponents: { TextField, NumberField, }, formComponents: { SubmitButton, }, fieldContext, formContext, }) const PeoplePage = () => { const form = useAppForm({ defaultValues: { username: '', age: 0, }, validators: { // Pass a schema or function to validate onChange: z.object({ username: z.string(), age: z.number().min(13), }), }, onSubmit: ({ value }) => { // Do something with form data alert(JSON.stringify(value, null, 2)) }, }) return (