vue/compose-with-tanstack-store

Compose TanStack Table state slices in Vue with TanStack Store atoms.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Compose external, shareable TanStack Table state slices in Vue so sorting, pagination, filters, and selection stay consistent across components without fragile prop-drilling or callback plumbing.

Core Features & Use Cases

  • External slice ownership via atoms: Create your own state slices with createAtom and wire them into useTable using options.atoms for predictable cross-component sharing.
  • Reactive read surfaces: Read atom slices using useSelector (or computed) to keep Vue updates efficient and narrowly scoped.
  • Correct precedence and wiring: Ensure the table uses atoms[slice] over state[slice] to avoid silent dead configuration, and understand how table.reset() interacts with owned vs internal slices.
  • When to use atoms vs controlled state: Persist slices, coordinate side effects, and integrate with query keys by driving changes directly from atom writes.

Quick Start

Ask an AI to show how to create a stable sorting and pagination atom with @tanstack/vue-store, pass them via options.atoms into useTable, and read them reactively with useSelector so multiple Vue components share the same table state.

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

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

FAQPage Schema
How do I share TanStack Table sorting and pagination state across Vue components?

To share TanStack Table state across Vue components, create state slices using TanStack Store atoms and pass them into `useTable` via `options.atoms`. This provides shared, reactive control over sorting and pagination without prop-drilling.

What is the best way to manage external table state in Vue without prop-drilling?

The best way to manage external table state in Vue without prop-drilling is using TanStack Store atoms. You create slices with `createAtom` and read them reactively using `useSelector` or `computed` for efficient, narrowly scoped component updates.

How do I read TanStack Store atoms reactively inside a Vue component?

You read TanStack Store atoms reactively in a Vue component using the `useSelector` hook or Vue's native `computed` function. This ensures efficient reactive reads that keep component updates narrowly scoped to the specific table state slice.

Why does my TanStack Table ignore the sorting state I configured in Vue?

Your TanStack Table ignores sorting state in Vue when `options.state[slice]` overrides your `options.atoms[slice]`. Ensure correct precedence by passing atoms via `options.atoms` so the table prioritizes atom ownership over internal state to avoid dead configuration.

Can I use TanStack Store atoms for Vue table state persistence and query integration?

Yes, you can use TanStack Store atoms for Vue table state persistence and query integration. Driving changes directly from atom writes allows you to persist slices, coordinate side effects, and integrate seamlessly with reactive query keys.