secondsky/claude-skills / plugins/tanstack-table/skills/tanstack-table
tanstack-table
VerifiedTanStack Table v8 headless data tables with server-side features for Cloudflare Workers + D1. Use for pagination, filtering, sorting, virtualization, or encountering state management, TanStack Query coordination, URL sync errors.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 22.1 KB |
| references/cloudflare-d1-examples.md | markdown | 3.4 KB |
| references/common-errors.md | markdown | 4.5 KB |
| references/feature-controls.md | markdown | 4.3 KB |
| references/performance-virtualization.md | markdown | 2.4 KB |
| references/query-integration.md | markdown | 5.1 KB |
| references/server-side-patterns.md | markdown | 8.9 KB |
| templates/basic-client-table.tsx | other | 2.7 KB |
| templates/column-configuration.tsx | other | 4.1 KB |
| templates/controlled-table-state.tsx | other | 9.0 KB |
| templates/d1-database-example.tsx | other | 9.2 KB |
| templates/package.json | manifest | 631 B |
| templates/server-paginated-table.tsx | other | 6.2 KB |
| templates/shadcn-styled-table.tsx | other | 3.2 KB |
| templates/virtualized-large-dataset.tsx | other | 4.7 KB |
templates/column-configuration.tsx
View on GitHub/**
* Type-Safe Column Configuration Patterns
*
* Shows best practices for defining columns with TypeScript.
* Use createColumnHelper for full type safety.
*/
import { createColumnHelper, ColumnDef } from '@tanstack/react-table'
interface User {
id: string
firstName: string
lastName: string
email: string
age: number
status: 'active' | 'inactive'
createdAt: Date
}
// ============================================
// Method 1: Column Helper (RECOMMENDED for TypeScript)
// ============================================
const columnHelper = createColumnHelper<User>()
export const columnsWithHelper = [
columnHelper.accessor('id', {
header: 'ID',
size: 80,
}),
columnHelper.accessor('firstName', {
header: 'First Name',
cell: info => info.getValue(), // Fully typed!
}),
columnHelper.accessor('lastName', {
header: 'Last Name',
}),
// Computed column (combines multiple fields)
columnHelper.accessor(
row => `${row.firstName} ${row.lastName}`,
{
id: 'fullName',
header: 'Full Name',
cell: info => <strong>{info.getValue()}</strong>,
}
),
columnHelper.accessor('email', {
header: 'Email',
cell: info => (
<a href={`mailto:${info.getValue()}`} className="text-blue-600 underline">
{info.getValue()}
</a>
),
}),
columnHelper.accessor('age', {
header: 'Age',
size: 80,
}),
columnHelper.accessor('status', {
header: 'Status',
cell: info => (
<span
className={`px-2 py-1 rounded text-xs ${
info.getValue() === 'active'
? 'bg-green-100 text-green-800'
: 'bg-gray-100 text-gray-800'
}`}
>
{info.getValue()}
</span>
),
}),
columnHelper.accessor('createdAt', {
header: 'Created',
cell: info => info.getValue().toLocaleDateString(),
enableSorting: true,
}),
]
// ============================================
// Method 2: Manual ColumnDef (TypeScript)
// ============================================
export const columnsManual: ColumnDef<User>[] = [
{
accessorKey: 'id',
header: 'ID',
},
{
accessorKey: 'firstName',
header: 'First Name',
},
{
accessorKey: 'email',
header: 'Email',
},
]
// ============================================
// Advanced: Column with Custom Cell Rendering
// ============================================
export const advancedColumns = [
columnHelper.accessor('id', {
header: 'ID',
}),
columnHelper.display({
id: 'actions',
header: 'Actions',
cell: props => (
<div className="flex gap-2">
<button
onClick={() => console.log('Edit', props.row.original.id)}
className="px-2 py-1 bg-blue-500 text-white rounded text-sm"
>
Edit
</button>
<button
onClick={() => console.log('Delete', props.row.original.id)}
className="px-2 py-1 bg-red-500 text-white rounded text-sm"
>
Delete
</button>
</div>
),
}),
]
// ============================================
// Advanced: Column with Sorting/Filtering
// ============================================
export const sortableFilterableColumns = [
columnHelper.accessor('firstName', {
header: 'First Name',
enableSorting: true,
enableColumnFilter: true,
}),
columnHelper.accessor('age', {
header: 'Age',
enableSorting: true,
enableColumnFilter: true,
filterFn: 'inNumberRange', // Built-in filter function
}),
columnHelper.accessor('status', {
header: 'Status',
enableColumnFilter: true,
filterFn: 'equals', // Exact match
}),
]
// ============================================
// Advanced: Column with Meta Data
// ============================================
declare module '@tanstack/react-table' {
interface ColumnMeta<TData, TValue> {
className?: string
headerClassName?: string
}
}
export const columnsWithMeta = [
columnHelper.accessor('id', {
header: 'ID',
meta: {
className: 'text-gray-600',
headerClassName: 'bg-gray-50',
},
}),
columnHelper.accessor('email', {
header: 'Email',
meta: {
className: 'font-mono text-sm',
},
}),
]
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |