vue/table-state

Wire TanStack Vue Table v9 state into Vue reactivity with useTable patterns.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you wire TanStack Table v9 state into Vue reactivity so sorting, filtering, selection, and pagination update reliably without missing updates or stale reads.

Core Features & Use Cases

  • Vue reactivity binding for tables: Uses vueReactivity() to map readonly atoms to computed() and writable atoms to shallowRef(), with synchronous watch subscriptions to keep the UI in sync.
  • Three surfaces for consuming state: Access per-slice atoms via table.atoms.<slice>, read a flat snapshot via table.store.state, and use the useTable(..., selector) return for Vue-selected state.
  • External state integration: Supports external atoms via @tanstack/vue-store (createAtom, useSelector) or external state with on[State]Change handlers, requiring Vue-tracked getters for reactive refs.
  • Rendering & subscriptions: Use <FlexRender> for headers/cells/footers and table.Subscribe when cross-store subscription parity is needed.

Quick Start

Install the Vue adapters, import useTable and FlexRender, define stable tableFeatures() and columns at module scope, pass reactive ref/computed options into useTable, and render headers/rows with FlexRender to get fully reactive table behavior.

Frequently Asked Questions about vue/table-state

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

FAQPage Schema
How do I make TanStack Table state reactive in Vue?

To make TanStack Table state reactive in Vue, use the `useTable` pattern with `vueReactivity()` to map readonly atoms to `computed()` and writable atoms to `shallowRef()`, ensuring synchronous `watch` subscriptions for UI synchronization.

Why are my Vue table sorting and filtering updates stale?

Vue table sorting and filtering updates appear stale when state isn't properly wired into Vue reactivity; using `vueReactivity()` with correct `tableFeatures` registration ensures atoms map to `computed()` and `shallowRef()` for reliable updates.

How do I sync external state with TanStack Vue Table?

Sync external state with TanStack Vue Table by using external atoms via `@tanstack/vue-store` (`createAtom`, `useSelector`) or external `state` with `on[State]Change` handlers, requiring Vue-tracked getters for reactive refs.

Can I use FlexRender for Vue table headers and cells?

Yes, you can use `<FlexRender>` to render Vue table headers, cells, and footers, which integrates with the reactive `useTable` setup to display fully reactive table behavior across sorting, filtering, and pagination.

What's the best way to access per-slice table state in Vue?

The best way to access per-slice table state in Vue is through three surfaces: per-slice atoms via `table.atoms.<slice>`, a flat snapshot via `table.store.state`, and Vue-selected state using the `useTable(..., selector)` return.

Does TanStack Vue Table support cross-store subscription parity?

TanStack Vue Table supports cross-store subscription parity by using `table.Subscribe` when synchronization across different stores is needed, complementing the standard `vueReactivity()` binding for reactive options and atom-backed slices.