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

getting-started

O que ela faz

Esta habilidade mostra como construir uma tabela de dados em um aplicativo Ember com o TanStack Table. Serve para desenvolvedores Ember que querem usar a biblioteca para o layout das tabelas.

Quando usar

  • ✓Quando você está criando uma página Ember que precisa de uma tabela de registros.
  • ✓Quando você quer usar o estilo de componente com template-tag do Ember para uma tabela.
  • ✓Quando os dados da sua tabela estão guardados em propriedades rastreadas e precisam ser atualizados na tela.

Link da skill

https://github.com/TanStack/table/blob/main/packages/ember-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/ember-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

“Preciso de uma tabela no meu aplicativo Ember que liste os meus usuários. Como configuro o TanStack Table?”

5 skills novas por semana. 1 minuto de leitura.

Como funciona

Ela oferece um exemplo de componente que define as colunas, cria a tabela e percorre as linhas e células no template.

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

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

Load intent load @tanstack/table-core#core first for the headless model, stable inputs, and column inference.

Ember 5.8 or newer requires Embroider or ember-auto-import v2. Prefer .gts or .gjs template-tag components with Glint.

Setup

import Component from '@glimmer/component'
import { tracked } from '@glimmer/tracking'
import {
  FlexRenderCell,
  createColumnHelper,
  tableFeatures,
  useTable,
  type Cell,
  type Row,
} from '@tanstack/ember-table'

type Person = { id: string; name: string }

const features = tableFeatures({})
const columnHelper = createColumnHelper<typeof features, Person>()
const columns = columnHelper.columns([
  columnHelper.accessor('name', { header: 'Name' }),
])
const initialData: Person[] = [{ id: '1', name: 'Ada' }]
const getRowId = (row: Person) => row.id

const getAllCells = (
  row: Row<typeof features, Person>,
): Array<Cell<typeof features, Person>> => row.getAllCells()

export default class PeopleTable extends Component {
  @tracked data = initialData

  table = useTable(this, () => ({
    features,
    columns,
    data: this.data,
    getRowId,
  }))

  get rows() {
    return this.table.getRowModel().rows
  }

  <template>
    <table>
      <tbody>
        {{#each this.rows as |row|}}
          <tr>
            {{#each (getAllCells row) as |cell|}}
              <td><FlexRenderCell @cell={{cell}} /></td>
            {{/each}}
          </tr>
        {{/each}}
      </tbody>
    </table>
  </template>
}

Construction and rendering

useTable takes an options thunk. Read tracked data inside it, and keep features, atoms, and columns stable. In a component, pass this as the owner to bind external-atom cleanup to the component lifecycle. The one-argument thunk form remains available for standalone tables.

Read Table APIs in template-consumed getters. Column, row, cell, and header prototype methods require their receiver, so use a getter or module helper such as getAllCells(row) rather than an extracted method. Wrap event calls the same way.

Use FlexRenderCell, FlexRenderHeader, and FlexRenderFooter for the matching object. Rendered components receive @ctx and optional @options through flexRenderComponent(Component, options).

With tableFeatures({}), render row.getAllCells(). Register columnVisibilityFeature before switching to row.getVisibleCells().

Read for the task

  • When adding or configuring optional features, load intent load @tanstack/table-core#table-features and read only references for the requested behavior.
  • For state ownership or reactive reads, read table-state.
  • When tables share features, defaults, or reusable UI, read create-table-hook.

API discovery

Inspect node_modules/@tanstack/ember-table/declarations/index.d.ts, use-table.d.ts, signal.d.ts, and FlexRender.d.ts. Core feature APIs are in node_modules/@tanstack/table-core/dist/features/.

Perguntas frequentes

Qual versão do Ember é necessária?

A habilidade diz que o Ember 5.8 ou superior precisa de Embroider ou ember-auto-import v2.

Devo usar arquivos .gts?

A habilidade recomenda componentes com template-tag em arquivos .gts ou .gjs, com Glint para verificação de tipos.

De onde vêm os dados da tabela?

O exemplo guarda os dados em uma propriedade rastreada, então as mudanças nela aparecem na tabela.

Detalhes

Descrição original do autor

Create and render Table v9 with the ember adapter. Route reusable createTableHook defaults, and framework setup; use table-state for reactive ownership.

repo: TanStack/table

Popularidade

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

Essa skill é útil?

0

Entre para votar.

Comentários

  • …

Mais skills deste repositório

Skills parecidas