
Getting Started
Create and render Table v9 with the vue adapter.
Install
npx skills add TanStack/table --skill getting-started -g -a claude-code -y- Repository
- TanStack/table28.5k
- Category
- Engineering
- Updated
- 14d ago
- License
- MIT
- Context cost
- Lightabout 681 tokens
- Runs scripts
- No, instructions only
What it does
Create and render Table v9 with the vue adapter. Route reusable createTableHook components, Query and Virtual integration, and framework setup; use table-state for reactive ownership.
Vue Table setup and integration
Before starting, run intent load @tanstack/table-core#core for the shared headless model and stable-input rules.
Setup
<script setup lang="ts">
import { ref } from 'vue'
import { FlexRender, tableFeatures, useTable } from '@tanstack/vue-table'
type Person = { name: string; age: number }
const features = tableFeatures({})
const columns = [
{ accessorKey: 'name', header: 'Name' },
{ accessorKey: 'age', header: 'Age' },
]
const data = ref<Person[]>([{ name: 'Ada', age: 36 }])
const table = useTable({ features, columns, data })
</script>
<template>
<table>
<thead>
<tr v-for="group in table.getHeaderGroups()" :key="group.id">
<th v-for="header in group.headers" :key="header.id">
<FlexRender v-if="!header.isPlaceholder" :header="header" />
</th>
</tr>
</thead>
<tbody>
<tr v-for="row in table.getRowModel().rows" :key="row.id">
<td v-for="cell in row.getAllCells()" :key="cell.id">
<FlexRender :cell="cell" />
</td>
</tr>
</tbody>
</table>
</template>
Essential constraints
Use useTable with a ref, computed value, or reactive getter for changing data. Passing data.value captures one array and loses later updates. Keep static features and columns stable; derive transformed arrays with computed.
Table owns models and state. The application owns markup, CSS, interactions, and accessibility. Core-only tables use row.getAllCells(); visibility-aware methods need columnVisibilityFeature. Optional state and APIs require their features. Put row-model slots after their prerequisite features in tableFeatures().
