Pular para o conteúdo
Skillpedia
Sites e telas (frontend)29 mil · #9820

getting-started

O que ela faz

Esta habilidade mostra como construir uma tabela de dados em um aplicativo Preact com o TanStack Table. Serve para desenvolvedores que querem uma biblioteca de tabelas que funcione diretamente com o Preact.

Quando usar

  • ✓Quando você está criando um componente Preact que mostra uma lista de registros em uma tabela.
  • ✓Quando você precisa que os cabeçalhos e as células de uma tabela Preact sejam renderizados corretamente.
  • ✓Quando você pretende adicionar recursos de consulta ou de virtualização a uma tabela Preact no futuro.

Link da skill

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

Copie e cole na sua IA (Claude, ChatGPT ou Cursor) pedindo para seguir as instruções.

Como usar

O jeito mais fácil: copie a mensagem e cole na sua IA. Ela lê a skill e segue as instruções.

Mensagem pronta para colar

Use esta skill para me ajudar: https://github.com/TanStack/table/blob/main/packages/preact-table/skills/getting-started/SKILL.md Leia o arquivo SKILL.md desse link e siga as instruções dele na minha tarefa.
Quer que a sua IA encontre skills como esta sozinha?Instale o MCP grátis do Skillpedia: uma linha, e ela pesquisa entre 15.000+ skills antes de cada tarefa.Instalar em 1 minuto →

Exemplo do que pedir para a IA

“Estou criando uma página Preact que lista os membros da minha equipe em uma tabela. Como eu configuro?”

5 skills novas por semana. 1 minuto de leitura.

Como funciona

Ela oferece um componente de exemplo que define as colunas com um auxiliar, cria a tabela com um hook e percorre os cabeçalhos e as linhas para desenhar a tabela.

Conteúdo técnico (SKILL.md original)

Texto original do autor, em inglês, direto do GitHub.

Preact Table setup and integration

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

Setup

import { useState } from 'preact/hooks'
import {
  createColumnHelper,
  tableFeatures,
  useTable,
} from '@tanstack/preact-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] = useState<Person[]>([{ name: 'Ada' }])
  const table = useTable({ features, columns, data })
  return (
    <table>
      <thead>
        {table.getHeaderGroups().map((group) => (
          <tr key={group.id}>
            {group.headers.map((header) => (
              <th key={header.id}>
                <table.FlexRender header={header} />
              </th>
            ))}
          </tr>
        ))}
      </thead>
      <tbody>
        {table.getRowModel().rows.map((row) => (
          <tr key={row.id}>
            {row.getAllCells().map((cell) => (
              <td key={cell.id}>
                <table.FlexRender cell={cell} />
              </td>
            ))}
          </tr>
        ))}
      </tbody>
    </table>
  )
}

Essential constraints

Use native @tanstack/preact-table and preact/hooks. V8 React-through-compat setup and useReactTable are not the native v9 API. Keep features, columns, and fallback arrays stable across renders.

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

Perguntas frequentes

Preciso ler antes o guia principal do TanStack Table?

A habilidade pede que você leia antes o guia principal compartilhado, para o modelo básico e as regras estáveis de entrada.

Devo usar a versão React da biblioteca?

Não. A habilidade diz para usar o pacote Preact nativo e os hooks do Preact.

Onde os dados da tabela devem ficar?

O exemplo os guarda no estado do Preact com useState e os passa para a tabela.

Detalhes

Descrição original do autor

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

repo: TanStack/table

Popularidade

Estrelas no GitHub
29 mil
Posição no ranking
#9820
Licença
MIT
Atualizada em
21/10/2026

Essa skill é útil?

0

Entre para votar.

Comentários

  • …

Mais skills deste repositório

Skills parecidas