Skip to content
Skillpedia
Websites & UI (frontend)29k · #9808

getting-started

What it does

This skill shows how to build a table in an Angular app with TanStack Table, from defining columns and data to displaying the rows. It is for Angular developers who want to build their own table layout.

When to use it

  • ✓When you are creating an Angular component that shows a list of records in a table.
  • ✓When your Angular table data comes from signals and must refresh on screen.
  • ✓When you want to add Query or Virtual features to an Angular table.

Skill link

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

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/TanStack/table/blob/main/packages/angular-table/skills/getting-started/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute →

Example of what to ask your AI

“I need a table in my Angular app that shows a list of orders. How do I set it up?”

5 new skills a week. 1 minute to read.

How it works

It explains how to call injectTable inside a component, pass in columns and data, and then loop over the rows in the template using the FlexRender directive.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

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

Setup

import { Component, signal } from '@angular/core'
import { FlexRender, injectTable, tableFeatures } from '@tanstack/angular-table'

type Person = { name: string; age: number }
const features = tableFeatures({})
const columns = [
  { accessorKey: 'name', header: 'Name' },
  { accessorKey: 'age', header: 'Age' },
]

@Component({
  selector: 'app-table',
  imports: [FlexRender],
  template: `<table>
    <tbody>
      @for (row of table.getRowModel().rows; track row.id) {
        <tr>
          @for (cell of row.getAllCells(); track cell.id) {
            <td>
              <ng-container *flexRenderCell="cell; let value">{{
                value
              }}</ng-container>
            </td>
          }
        </tr>
      }
    </tbody>
  </table>`,
})
export class TableComponent {
  readonly data = signal<Person[]>([{ name: 'Ada', age: 36 }])
  readonly table = injectTable(() => ({ features, columns, data: this.data() }))
}

Construction and rendering

Call injectTable in a component, directive, or service field initializer, or another valid Angular injection context. The adapter binds its cleanup to that context.

Signals read in the options initializer rerun it and call setOptions. Keep features, factories, and columns outside the initializer; return stable data references and derive transformed data with computed outside it.

Import FlexRender for *flexRender, *flexRenderCell, *flexRenderHeader, and *flexRenderFooter. Render values can be primitives, TemplateRef, component types, or flexRenderComponent(...). Use flexRenderComponent for Angular component types; ordinary render functions are already supported directly.

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.
  • When Query supplies data or server processing, read with-tanstack-query.
  • When virtualizing rows or columns, read with-tanstack-virtual.
  • When upgrading v8 code, read migrate-v8-to-v9.

API discovery

Inspect node_modules/@tanstack/angular-table/dist/types/ for the bundled public declarations. Inspect feature APIs under node_modules/@tanstack/table-core/dist/features/.

FAQ

Where should I call injectTable?

In a component or service field, or in another valid Angular injection context, so cleanup is handled for you.

What happens when my data is a signal?

The options are rerun when the signal changes, so the table updates with the new values.

Should columns be defined outside the component?

The skill recommends keeping features and columns outside the reactive options so they are not rebuilt on every update.

Details

Original description by the author

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

repo: TanStack/table

Popularity

GitHub stars
29k
Ranking position
#9808
License
MIT
Updated
10/21/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills