svelte/getting-started

Create typed TanStack Table v9 setups for Svelte 5 with reactive instances.

28.3k|3.6k|Updated Oct 20, 2016
One-click install
npx skills add https://github.com/TanStack/table --skill svelte-getting-started
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: svelte/getting-started
Source: https://github.com/TanStack/table/tree/main/packages/svelte-table/skills/svelte/getting-started
Command: npx skills add https://github.com/TanStack/table --skill svelte-getting-started

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It guides you through creating a working, typed TanStack table in Svelte 5 with the v9 adapter, avoiding common setup mistakes caused by the v9 shape and Svelte runes requirements.

Core Features & Use Cases

  • Svelte 5 + v9 setup: Ensures you’re using the required Svelte version and the correct adapter APIs for v9.
  • Explicit feature and row-model opt-in: Shows how to define _features and register the corresponding _rowModels factories so the table instance exposes the right derived APIs.
  • Strong typing with generics: Demonstrates createColumnHelper<typeof _features, TData>() and ColumnDef<typeof _features, TData> for type-safe columns and cells.
  • Reactive data + render: Uses $state with a get data() reactive getter and renders cells/headers with FlexRender, including best practices like keyed {#each} blocks.
  • Add a feature like pagination: Illustrates how to enable pagination and react to table state from UI controls.
  • Multi-table reuse: Introduces createTableHook/createAppTable patterns for sharing feature and row-model configuration across an app.

Quick Start

Ask the AI to produce a minimal Svelte 5 v9 @tanstack/svelte-table setup that defines _features, _rowModels, typed columns for a Person type, creates the table with createTable({ get data() }), and renders headers and rows using FlexRender.

Frequently Asked Questions about svelte/getting-started

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up a TanStack table in Svelte 5 using runes?

To set up a TanStack table in Svelte 5, use `createTable(options)` with `_features` and `_rowModels`, provide a reactive `get data()` getter using `$state`, and render cells via `FlexRender`.

What's the best way to define type-safe columns for a Svelte 5 TanStack table?

Define type-safe columns by using `createColumnHelper<typeof _features, TData>()` to generate `ColumnDef` objects, ensuring your headers and cells are fully typed for your data structure.

Does TanStack Table v9 require explicit feature and row-model registration in Svelte?

Yes, TanStack Table v9 requires explicit opt-in for features and row models. You must define `_features` and register the corresponding `_rowModels` factories so the table exposes the right derived APIs.

How do I add pagination to a TanStack Table in a Svelte 5 application?

Add pagination to a TanStack Table by enabling the pagination feature in your table options and creating UI controls that react to the table state to navigate pages.

Why are my Svelte 5 TanStack table rows not updating when data changes?

Table rows fail to update if data isn't reactive. Use a `get data()` reactive getter backed by Svelte 5 `$state` so the table instance reacts to data changes correctly.

Can I reuse table configuration across multiple tables in a Svelte 5 app?

Yes, you can reuse table configuration across multiple tables by introducing `createTableHook` or `createAppTable` patterns to share feature and row-model setups throughout your application.