mirror of
https://github.com/TanStack/table.git
synced 2026-11-18 18:55:54 +00:00
|
…
|
History | |
|---|---|---|
| .. | ||
| src | ||
| .gitignore | ||
| index.html | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
| vite.config.js | ||
Editable Data with TanStack Form
This example demonstrates integrating TanStack Form with TanStack Table for editable data management.
Features
- Form-based editing: Each table cell is a form field managed by TanStack Form
- Array field management: Table data is stored as a form array with indexed field access
- Validation: Per-field Zod validation with error display
- Form state tracking: Dirty/pristine and valid/invalid indicators
- Pagination & Filtering: Full table features work with form-managed data
Key Patterns
useAppFormwithdefaultValues: { data: [...] }for array dataform.AppField name="data[${row.index}].fieldName"for cell editingtable.Subscribefor reactive table statetable.FlexRenderfor cell rendering
Running the Example
pnpm install
pnpm dev