Skip to content
Skillpedia
Websites & UI (frontend)29k · #9831

getting-started

What it does

This skill shows how to create and display a data table in a Svelte app using TanStack Table. It is for Svelte developers who use Svelte 5 and want a table they can style freely.

When to use it

  • ✓When you are building a Svelte component that shows records in a table.
  • ✓When your Svelte table data is held in runes and must update on screen.
  • ✓When you want to add query or virtual features to a Svelte table.

Skill link

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

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/TanStack/table/blob/main/packages/svelte-table/skills/getting-started/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute →

Example of what to ask your AI

“I am building a Svelte 5 page that lists my users in a table. How do I set it up?”

5 new skills a week. 1 minute to read.

How it works

It gives a component that defines columns, creates the table with createTable and loops over the headers, rows and cells in the template.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Svelte Table setup and integration

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

Setup

Keep features and columns outside reactive work; expose changing rune values through getters.

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

  type Person = { firstName: string; age: number }
  const features = tableFeatures({})
  const columns = [
    { accessorKey: 'firstName', header: 'First name' },
    { accessorKey: 'age', header: 'Age' },
  ]
  let data = $state<Person[]>([{ firstName: 'Ada', age: 36 }])

  const table = createTable({
    features,
    columns,
    get data() {
      return data
    },
  })
</script>

<table>
  <thead>
    {#each table.getHeaderGroups() as group (group.id)}
      <tr
        >{#each group.headers as header (header.id)}<th
            >{#if !header.isPlaceholder}<FlexRender {header} />{/if}</th
          >{/each}</tr
      >
    {/each}
  </thead>
  <tbody>
    {#each table.getRowModel().rows as row (row.id)}
      <tr
        >{#each row.getAllCells() as cell (cell.id)}<td
            ><FlexRender {cell} /></td
          >{/each}</tr
      >
    {/each}
  </tbody>
</table>

Essential constraints

V9 requires Svelte 5 and createTable. Expose changing runes through getters; data captured once cannot follow reassignment. Keep features and columns outside reactive work and use $derived for transformed arrays.

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/svelte-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/.

FAQ

Which Svelte version does this need?

The skill says Svelte 5 is required for Table v9.

How does changing data reach the table?

The skill recommends exposing the rune value through a getter, so the table always reads the current value.

What draws the cells in the table?

The FlexRender component draws the headers and cells.

Details

Original description by the author

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

repo: TanStack/table

Popularity

GitHub stars
29k
Ranking position
#9831
License
MIT
Updated
10/21/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills