本文へスキップ
Skillpedia
WebサイトとUI(フロントエンド)29k · #9828

getting-started

できること

SolidアプリでTanStack Tableを使い、データのテーブルを作成して表示する方法を説明します。自分でテーブルのレイアウトを作りたいSolid開発者向けです。

使う場面

  • ✓レコードの一覧をテーブルで表示するSolidコンポーネントを作っているとき。
  • ✓Solidテーブルのデータがシグナルから来ていて、画面で更新される必要があるとき。
  • ✓Solidテーブルにクエリや仮想化の機能を追加したいとき。

スキルのリンク

https://github.com/TanStack/table/blob/main/packages/solid-table/skills/getting-started/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/TanStack/table/blob/main/packages/solid-table/skills/getting-started/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“注文の一覧をテーブルで表示するSolidのページを作っています。設定方法を教えてください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

列を定義し、createTableでテーブルを作成し、Forコンポーネントでヘッダー、行、セルをループ表示するコンポーネントの例を示します。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

Solid Table setup and integration

Before starting, run intent load @tanstack/table-core#core for the shared headless model and stable-input rules.

Setup

import { For, createSignal } from 'solid-js'
import {
  createColumnHelper,
  createTable,
  tableFeatures,
} from '@tanstack/solid-table'

type Person = { name: string }
const features = tableFeatures({})
const helper = createColumnHelper<typeof features, Person>()
const columns = helper.columns([helper.accessor('name', { header: 'Name' })])

export function PeopleTable() {
  const [data] = createSignal<Person[]>([{ name: 'Ada' }])
  const table = createTable({
    features,
    columns,
    get data() {
      return data()
    },
  })
  return (
    <table>
      <thead>
        <For each={table.getHeaderGroups()}>
          {(group) => (
            <tr>
              <For each={group.headers}>
                {(header) => (
                  <th>
                    <table.FlexRender header={header} />
                  </th>
                )}
              </For>
            </tr>
          )}
        </For>
      </thead>
      <tbody>
        <For each={table.getRowModel().rows}>
          {(row) => (
            <tr>
              <For each={row.getAllCells()}>
                {(cell) => (
                  <td>
                    <table.FlexRender cell={cell} />
                  </td>
                )}
              </For>
            </tr>
          )}
        </For>
      </tbody>
    </table>
  )
}

Essential constraints

Use createTable in a Solid owner. Preserve changing data with get data() { return data() }; data: data() captures a snapshot. Keep features and columns stable and derive transformed arrays with createMemo.

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-features and read only references needed by the task.
  • For v8 code, read the migration checklist.

API discovery

Inspect node_modules/@tanstack/solid-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/.

よくある質問

Solidでテーブルを作るのはどの関数ですか?

Solidアダプターのcreatetableを使い、コンポーネント内で呼び出します。

データの変更はテーブルにどう伝わりますか?

例ではゲッターを使ってデータを渡すので、テーブルは常に最新のシグナルの値を読み取ります。

コアのガイドも読む必要がありますか?

はい。このスキルは、まず共通のコアガイドでヘッドレスの仕組みと安定した入力のルールを読むよう求めています。

詳細

作者による元の説明

Create and render Table v9 with the solid adapter. Route reusable createTableHook components, Query and Virtual integration, and framework setup; use table-state for reactive ownership.

repo: TanStack/table

人気

GitHubのスター
29k
ランキング
#9828
ライセンス
MIT
更新日
2026/10/21

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル