getting-started
できること
VueアプリでTanStack Tableを使い、データのテーブルを作成して表示する方法を説明します。テーブルの見た目と制御を自分で決めたいVue開発者向けです。
使う場面
- ✓レコードを表示するVueコンポーネントを作っているとき。
- ✓Vueテーブルのデータが時間とともに変わり、画面で更新される必要があるとき。
- ✓Vueテーブルにクエリや仮想化の機能を追加したいとき。
スキルのリンク
https://github.com/TanStack/table/blob/main/packages/vue-table/skills/getting-started/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“ユーザー一覧をテーブルで表示するVueのページを作っています。設定方法を教えてください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
列を定義し、useTableでテーブルを作成し、テンプレート内でヘッダー、行、セルをループ表示する単一ファイルのコンポーネントを示します。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
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().
Load by task
- For repeated features, defaults, typed contexts, or component registries, read reusable app hooks.
- For Query-backed data, server pages, sorting, filtering, or request keys, read TanStack Query integration.
- For virtual rows, columns, dynamic measurement, or infinite scrolling, read TanStack Virtual integration.
- For controlled state, tracked reads, or render subscriptions, read table state.
- For feature registration, missing feature APIs, or processing ownership, run
intent load @tanstack/table-core#table-featuresand read only references needed by the task. - For v8 code, read the migration checklist.
API discovery
Inspect node_modules/@tanstack/vue-table/dist/index.d.ts, then the exported adapter declarations for the installed version. Inspect optional core APIs under node_modules/@tanstack/table-core/dist/features/.
よくある質問
変わるデータはどう渡せばよいですか?
refや算出値(computed)、リアクティブなゲッターを使うよう、このスキルは説明しています。一度だけ渡すと、後の更新が伝わらないからです。
先にコアガイドを読む必要がありますか?
はい。このスキルは、まず共通のコアガイドでヘッドレスの仕組みを読むよう求めています。
どのVueのバージョンが必要ですか?
Vue向けの移行ガイドでは、Table v9にはVue 3.2以上が必要だと説明しています。
詳細
作者による元の説明
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.
repo: TanStack/table
人気
- GitHubのスター
- 29k
- ランキング
- #9841
- ライセンス
- MIT
- 更新日
- 2026/10/21
コメント
- …
このリポジトリの他のスキル
getting-started
29kエージェントが、Alpine.jsでTanStack Tableを使ってデータテーブルを作り、表示する方法を教えます。セットアップ、リアクティブなデータ、行の描画を扱います。
table-state
29kエージェントが、Alpine.jsで表の状態(現在のページなど)を読み取り、制御する方法を教えます。その状態が変わると、画面が更新されます。
devtools
29kエージェントが、Angularの表をTanStack Devtoolsのパネルに登録する方法を教えます。開発者はアプリを作りながら、各表を調べられます。
getting-started
29kエージェントが、AngularでTanStack Tableの表を作り、表示する方法を教えます。injectTableの設定、テンプレートの描画、行データの更新を扱います。
似ているスキル
angular-developer
280kエージェントがAngularのコードを作成し、プロジェクト構成についてアドバイスできるようにします。新しいプロジェクトの開始、コード部品の作成、パフォーマンスやアクセシビリティの改善に役立ちます。
frontend-a11y
280kエージェントが Web インターフェースを誰にとっても使いやすくするよう支援します。スクリーンリーダーやキーボード操作に対応し、サイトやアプリが適切に動作するようにします。
frontend-patterns
280kエージェントがフロントエンド開発の最新パターンを適用できるようにします。React と Next.js において、パフォーマンスの最適化、状態管理、ベストプラクティスの遵守を行います。