vue/compose-with-tanstack-form

Compose TanStack Vue Table with TanStack Vue Form for editable datagrids.

28.3k|3.6k|Updated Oct 20, 2016
One-click install
npx skills add https://github.com/TanStack/table --skill vue-compose-with-tanstack-form
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: vue/compose-with-tanstack-form
Source: https://github.com/TanStack/table/tree/main/packages/vue-table/skills/vue/compose-with-tanstack-form
Command: npx skills add https://github.com/TanStack/table --skill vue-compose-with-tanstack-form

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Building editable datagrids often leads to tangled state management, rerender performance problems, and hard-to-type recursive row data when using Vue.

Core Features & Use Cases

  • Form-owned row data: Keep the source of truth in @tanstack/vue-form and have @tanstack/vue-table render from that state.
  • Cell bindings per row index: Bind each editable cell to the corresponding field path like data[${row.index}].fieldName using <form.Field>.
  • Performance-safe subscriptions: Subscribe to data length for row add/remove re-renders instead of subscribing to the entire data array on every keystroke.
  • Recursive row typing fix: Use Omit<Row, 'subRows'> for the form row type to avoid TS2589 caused by DeepKeys recursion.
  • Use Case: Create an editable, paginated Vue table where each row can be added/removed and each cell updates form state with validation and submit handled by the form.

Quick Start

Ask an AI agent to generate a Vue example that composes @tanstack/vue-table with @tanstack/vue-form using form.state.values.data as the table data source and <form.Field name="data[${row.index}].fieldName"> bindings for each cell.

Frequently Asked Questions about vue/compose-with-tanstack-form

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build an editable Vue table with TanStack Form?▼

To build an editable Vue table, compose @tanstack/vue-table with @tanstack/vue-form by sourcing table data from form.state.values.data and binding each cell through <form.Field> using row.index paths, allowing the form to own row state while the table manages layout and row models.

Why does my Vue table rerender on every keystroke when editing cells?▼

Your Vue table rerenders on every keystroke because it subscribes to the entire data array. Use length-only subscriptions for row add/remove re-renders to avoid rerendering the entire table on every keystroke while maintaining reactive performance.

How do I fix TS2589 recursive type errors in TanStack Vue Form?▼

Fix TS2589 recursive type errors in TanStack Vue Form by using Omit<Row, 'subRows'> for the form row type. This prevents DeepKeys recursion issues when defining optional recursive row data shapes in your editable table.

Can I add and remove rows in a paginated Vue datagrid using TanStack Form?▼

Yes, you can add and remove rows in a paginated Vue datagrid by having TanStack Form own the source of truth. The table renders from form.state.values.data, supporting cell-level editing, row add/remove, and pagination while the form handles validation and submit.

What is the best way to manage state for an editable datagrid in Vue?▼

The best way to manage state for an editable datagrid in Vue is form-owned row data. Keep the source of truth in @tanstack/vue-form and have @tanstack/vue-table render from that state to prevent tangled state management and rerender performance problems.

How do I bind table cells to form fields in Vue?▼

Bind table cells to form fields in Vue by mapping each editable cell to the corresponding field path like data[${row.index}].fieldName using the <form.Field> component. This ensures each cell updates the form state directly based on its row index.