Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

tanstack-table

БесплатноБез исполняемых скриптовНе проверен

TanStack Table is a headless table library for React, Vue, Svelte, Solid, Angular and Lit that handles sorting, filtering, pagination, row selection and…

TerminalSkillsот TerminalSkills★ 221 звезда на GitHub

Об этом скилле

TanStack Table

Overview

TanStack Table is a headless table library: it manages table state and logic (sorting, filtering, pagination, selection, visibility, pinning, grouping) and you render every element yourself, so there are no built-in styles. The current release is v9 (@tanstack/react-table 9.3.x, October 2026), which changed the API from v8: features are opt-in and declared in tableFeatures(...), the hook is useTable (not useReactTable), and rendering uses table.FlexRender. v8 (8.21.3) still works if a project is pinned to it; check package.json before writing code, because the two APIs do not mix.

Instructions

Setup

npm install @tanstack/react-table        # v9; use @tanstack/react-table@8 to stay on v8

Other adapters: @tanstack/vue-table, @tanstack/svelte-table (Svelte 5), @tanstack/solid-table, @tanstack/angular-table, @tanstack/lit-table.

The v9 model

  1. Declare features = tableFeatures({ ... }) once at module scope. Register each feature you use (rowSortingFeature, columnFilteringFeature, globalFilteringFeature, rowPaginationFeature, rowSelectionFeature, columnVisibilityFeature, columnResizingFeature, columnPinningFeature, columnOrderingFeature, rowExpandingFeature, columnGroupingFeature).
  2. For client-side work also register the row model factory in the same object: sortedRowModel: createSortedRowModel(), filteredRowModel: createFilteredRowModel(), paginatedRowModel: createPaginatedRowModel(). The core row model is automatic. Sorting needs sortFns; filtering needs the filter functions you name in filterFns (for example filterFns: { includesString: filterFn_includesString }).
  3. Type columns as ColumnDef<typeof features, Row>.
  4. Call useTable({ features, columns, data, ... }, selector). Table state is only re-read in components through the optional selector (second argument); (state) => state subscribes to all of it, then read table.state.pagination and so on.
  5. Render with <table.FlexRender header={header} /> and <table.FlexRender cell={cell} />.

Client-side table with search, sorting, pagination and selection

This code type-checks against 9.3.1 and renders with react-dom/server.

import { useState } from "react";
import {
  columnFilteringFeature,
  createFilteredRowModel,
  createPaginatedRowModel,
  createSortedRowModel,
  filterFn_includesString,
  globalFilteringFeature,
  rowPaginationFeature,
  rowSelectionFeature,
  rowSortingFeature,
  sortFns,
  tableFeatures,
  useTable,
} from "@tanstack/react-table";
import type { ColumnDef } from "@tanstack/react-table";

interface User {
  id: number;
  name: string;
  email: string;
  role: string;
  status: "active" | "inactive";
  joinedAt: string;
}

// v9: declare the features (and client-side row models) this table uses
const features = tableFeatures({
  rowSortingFeature,
  columnFilteringFeature,
  globalFilteringFeature,
  rowPaginationFeature,
  rowSelectionFeature,
  sortedRowModel: createSortedRowModel(),
  filteredRowModel: createFilteredRowModel(),
  paginatedRowModel: createPaginatedRowModel(),
  sortFns,
  filterFns: { includesString: filterFn_includesString },
});

const columns: ColumnDef<typeof features, User>[] = [
  {
    id: "select",
    header: ({ table }) => (
      <input
        type="checkbox"
        aria-label="Select all rows on this page"
        checked={table.getIsAllPageRowsSelected()}
        onChange={table.getToggleAllPageRowsSelectedHandler()}
      />
    ),
    cell: ({ row }) => (
      <input
        type="checkbox"
        aria-label={`Select ${row.original.name}`}
        checked={row.getIsSelected()}
        onChange={row.getToggleSelectedHandler()}
      />
    ),
  },
  { accessorKey: "name", header: "Name" },
  { accessorKey: "email", header: "Email" },
  { accessorKey: "role", header: "Role" },
  {
    accessorKey: "status",
    header: "Status",
    cell: (info) => (
      <span style={{ color: info.getValue() === "active" ? "green" : "gray" }}>
        {info.getValue<string>()}
      </span>
    ),
  },
  {
    accessorKey: "joinedAt",
    header: "Joined",
    cell: (info) => new Date(info.getValue<string>()).toLocaleDateString("en-US"),
  },
];

export function UsersTable({ data }: { data: User[] }) {
  const [globalFilter, setGlobalFilter] = useState("");

  const table = useTable(
    {
      features,
      columns,
      data, // keep this reference stable (state, query result, module constant)
      getRowId: (row) => String(row.id), // selection state is keyed by row id
      globalFilterFn: "includesString",
      state: { globalFilter },
      onGlobalFilterChange: setGlobalFilter,
      initialState: { pagination: { pageIndex: 0, pageSize: 10 } },
    },
    // selector: the slices that should re-render this component
    (state) => state,
  );

  return (
    <div>
      <input
        value={globalFilter}
        onChange={(e) => setGlobalFilter(e.target.value
Полный SKILL.md на GitHub

Установить tanstack-table в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

_scores.json

FAQ

Что делает скилл tanstack-table?

TanStack Table is a headless table library for React, Vue, Svelte, Solid, Angular and Lit that handles sorting, filtering, pagination, row selection and column state while you write the markup. Use when someone asks to "build a data table", "TanStack Table", "sortable table", "filterable data grid", "paginated table", "server-side pagination", "React table", or "headless table library", or when migrating code from v8 `useReactTable`.

Как установить скилл tanstack-table?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл tanstack-table запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить tanstack-table с