本文へ移動
cccskills
無料GitHub で公開

table-state

Read and control Table v9 state in svelte. Use for tracked reads, subscriptions, controlled slices, and framework-specific reactive boundaries.

インストール方法を見る

含まれるファイル(2)

  • SKILL.md3.0 KB
  • references/reactivity.md5.5 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Svelte table state

Before starting, run intent load @tanstack/table-core#table-state for shared ownership, initialization, updates, and resets.

Read reactive state

In Svelte 5, table.atoms.<slice>.get(), table.store.get(), and Table API reads track dependencies inside templates, $derived, $derived.by, or $effect. Outside those contexts they return snapshots. Prefer a slice read; a whole-store read reruns for every registered state change.

createTable and createAppTable take only options. There is no selected table.state, subscribeTable, or SubscribeSource. Use native $derived projections.

Control a slice

Keep features and columns stable. Expose changing data and controlled runes through getters, and resolve both forms of Updater:

<script lang="ts">
  import {
    createTable,
    rowPaginationFeature,
    tableFeatures,
    type PaginationState,
  } from '@tanstack/svelte-table'

  const features = tableFeatures({ rowPaginationFeature })
  const columns = [{ accessorKey: 'name' }]
  let data = $state([{ name: 'Ada' }])
  let pagination = $state<PaginationState>({ pageIndex: 0, pageSize: 20 })
  const table = createTable({
    features,
    columns,
    get data() {
      return data
    },
    state: {
      get pagination() {
        return pagination
      },
    },
    onPaginationChange: (next) => {
      pagination = typeof next === 'function' ? next(pagination) : next
    },
  })
  const pageSize = $derived(table.atoms.pagination.get().pageSize)
</script>

<button onclick={() => table.setPageSize(50)}>{pageSize} rows per page</button>

createTableState provides an updater-compatible getter/setter pair when repeating this wiring. For raw external atoms consumed outside table UI, use useSelector from @tanstack/svelte-store; table UI uses the rune-aware table.atoms wrappers.

For createTableState, external atoms, broad invalidation, or a page index overwritten by automatic reset, read reactivity details. For changes to pagination processing or reset policy, run intent load @tanstack/table-core#table-features and read its pagination reference.

API discovery

Inspect node_modules/@tanstack/svelte-table/dist/createTable.svelte.d.ts, createTableState.svelte.d.ts, and createTableHook.svelte.d.ts for the installed contracts.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

core

無料

Use TanStack Table v9 core architecture, stable data and columns, and inferred types. Route setup, missing APIs, row models, state, features, and framework-specific work.

日本語の概要は準備中です。原文の説明を表示しています。

TanStack/table2.8万2026年10月10日 更新

Implement a Table v9 plugin when built-ins and typed meta are insufficient. Covers FeatureMaps, runtime lifecycle hooks, prototypes, and a complete checked example.

日本語の概要は準備中です。原文の説明を表示しています。

TanStack/table2.8万2026年10月10日 更新

devtools

無料

Register Angular Table v9 instances with injectTanStackTableDevtools inside injection context. Load for reactive table registration, required options.key, enabled or undefined tables, cleanup, Angular isDevMode gating, or explicit production exports.

日本語の概要は準備中です。原文の説明を表示しています。

TanStack/table2.8万2026年10月10日 更新

devtools

無料

Connect Solid Table v9 instances to Devtools with tableDevtoolsPlugin and useTanStackTableDevtools in the proper reactive owner. Load for missing targets, required options.key, enabled state, cleanup, or development versus explicit production exports.

日本語の概要は準備中です。原文の説明を表示しています。

TanStack/table2.8万2026年10月10日 更新

devtools

無料

Connect native Preact Table v9 instances to Devtools with tableDevtoolsPlugin and useTanStackTableDevtools. Load for React-package mixups, missing targets, required options.key, enabled state, cleanup, or development gating.

日本語の概要は準備中です。原文の説明を表示しています。

TanStack/table2.8万2026年10月10日 更新

devtools

無料

Connect React Table v9 instances to Devtools with tableDevtoolsPlugin and useTanStackTableDevtools. Load for missing Table panels, registration lifecycle, required options.key, enabled state, or development versus explicit production exports.

日本語の概要は準備中です。原文の説明を表示しています。

TanStack/table2.8万2026年10月10日 更新

TanStack のスキルをすべて見る

このスキルの問題を報告する