Langsung ke konten
Skillpedia
Website & UI (frontend)29k · #9817

getting-started

Fungsinya

Skill ini menunjukkan cara membangun tabel data di aplikasi Octane dengan TanStack Table. Skill ini untuk pengembang yang memakai Octane dan sintaks template TSRX-nya.

Kapan dipakai

  • ✓Saat Anda membangun halaman Octane yang menampilkan daftar data dalam tabel.
  • ✓Saat Anda ingin tabel menampilkan header dan sel melalui helper rendernya.
  • ✓Saat Anda ingin mendefinisikan kolom tabel dengan helper kolom dalam file TSRX.

Link skill

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

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/TanStack/table/blob/main/packages/octane-table/skills/getting-started/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit →

Contoh permintaan ke AI

“Saya membangun halaman Octane yang menampilkan daftar produk dalam tabel. Bagaimana cara mengaturnya?”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Skill memberikan contoh komponen dengan kolom dan data, lalu melakukan loop pada header, baris, dan sel dalam markup untuk menampilkannya di halaman.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.

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

Setup

import { createRoot, useState } from 'octane'
import {
  createColumnHelper,
  tableFeatures,
  useTable,
} from '@tanstack/octane-table'

type Person = { name: string }
const features = tableFeatures({})
const helper = createColumnHelper<typeof features, Person>()
const columns = helper.columns([helper.accessor('name', { header: 'Name' })])

function PeopleTable() @{
  const [data] = useState<Person[]>([{ name: 'Ada' }])
  const table = useTable({ features, columns, data })

  <table>
    <thead>
      @for (const group of table.getHeaderGroups(); key group.id) {
        <tr>
          @for (const header of group.headers; key header.id) {
            <th><table.FlexRender header={header} /></th>
          }
        </tr>
      }
    </thead>
    <tbody>
      @for (const row of table.getRowModel().rows; key row.id) {
        <tr>
          @for (const cell of row.getAllCells(); key cell.id) {
            <td><table.FlexRender cell={cell} /></td>
          }
        </tr>
      }
    </tbody>
  </table>
}

const rootElement = document.getElementById('root')
if (!rootElement) throw new Error('Root element not found')
createRoot(rootElement).render(PeopleTable)

Construction and rendering

This adapter distributes authored TypeScript and TSRX. Configure the consumer with octane() in vite.config.ts and the TSRX JSX import source octane. Author component bodies with @{ ... } and keyed @for loops for rows, headers, and cells.

Import from @tanstack/octane-table. Render table.FlexRender as a component so it gets its own Octane scope. It preserves numbers including 0, render descriptors, and component functions.

Keep features and column definitions at module scope. For inputs that depend on component state, use useMemo; pass the current stable data array to useTable. Convert non-renderable values with String(value) when displaying them as text.

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/octane-table/src/index.d.ts, the matching *.tsrx.d.ts sidecar, and src/types.ts. This package publishes authored source; core APIs are in installed @tanstack/table-core/dist/.

Pertanyaan umum

Apa itu TSRX?

Contohnya ditulis dalam TSRX, sintaks komponen yang dipakai adapter ini, sehingga tampilannya berbeda dari JSX biasa.

Dari mana tabel mendapat datanya?

Contoh menyimpan data dalam state Octane dengan useState dan meneruskannya ke tabel.

Apakah ini menggantikan panduan inti tabel?

Tidak. Skill ini mengasumsikan Anda sudah membaca panduan inti tentang model tabel headless terlebih dahulu.

Detail

Deskripsi asli dari pembuat

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

repo: TanStack/table

Popularitas

Bintang GitHub
29k
Peringkat
#9817
Lisensi
MIT
Diperbarui
21/10/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa