custom-features
Fungsinya
Skill ini menunjukkan cara membangun fitur yang dapat digunakan ulang, atau plugin, yang menambahkan state atau perilaku baru ke TanStack Table. Skill ini untuk pengembang tingkat lanjut yang kebutuhannya tidak tercakup fitur bawaan.
Kapan dipakai
- ✓Saat Anda membutuhkan state atau perilaku yang dapat digunakan ulang dan harus ditambahkan ke objek tabel.
- ✓Saat opsi bawaan dan meta bertipe tidak bisa menangani renderer atau pengaturan aplikasi Anda.
- ✓Saat Anda menulis plugin yang harus mendaftarkan hook siklus hidup dan metode tabel dengan benar.
Link skill
https://github.com/TanStack/table/blob/main/packages/table-core/skills/custom-features/SKILL.mdSalin 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
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
“Fitur bawaan TanStack Table belum mencakup kebutuhan saya. Bagaimana cara menulis plugin sendiri?”
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Skill memandu cara mendeklarasikan fitur, menjaga state pengguna, menambahkan metode tabel dan objek selama hook siklus hidup, lalu mendaftarkan plugin dengan objek fitur yang stabil.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.
Author a custom feature
Read core and feature architecture first. Use a plugin for reusable state or behavior that must augment Table objects. Built-in options and typed tableMeta/columnMeta are usually enough for renderer callbacks and application configuration.
Implementation workflow
- Identify the state, options, and object methods the behavior owns. If it only passes callbacks or renderer data, read scoped meta typing and use meta instead.
- Before declaring plugin types or writing lifecycle hooks, read the complete plugin example. It enumerates all 10 public FeatureMaps, the API assignment helpers, lifecycle ordering, and the advanced row-model maps.
- Declare the feature key in
Plugins. Merge only FeatureMaps with matching runtime implementations; declarations alone install no behavior. - Preserve user state after defaults in
getInitialState; connect state updaters in default options. Install table methods withassignTableAPIsand object methods withassignPrototypeAPIsinside the corresponding lifecycle hooks. - Keep the feature object and
tableFeatures({ customFeature })result stable. Register the plugin throughtableFeaturesso inference and composition include it. - Verify the advertised state, options, methods, and resets on a constructed table. Each declared API must exist at runtime; reset behavior must respect the state owner.
Lifecycle boundaries
Use initTableInstanceData for mutable data owned by one table and resetTableInstanceData for clearing its transient contents. All feature initialization finishes before any constructTableAPIs hook. Keep method installation separate from data allocation.
Prototype methods are shared across the table's rows, columns, cells, or headers. Read per-object values through the method's current instance, and use the supported instance-data hooks for mutable fields. Read the example's installation rules before adding memoized methods or advanced row-model/cache wiring.
Common failures
- Types without matching runtime hooks advertise APIs that do not exist.
- Ad hoc mutation of constructed instances bypasses feature registration and inferred composition.
- Treating the density example as the only extension pattern misses column definitions and the other public FeatureMaps. Choose the maps required by the behavior; advanced row-model declarations also require runtime pipeline/cache wiring.
Installed API discovery
Inspect node_modules/@tanstack/table-core/dist/types/TableFeatures.d.ts, the exported *_FeatureMap interfaces in dist/types/, and assignTableAPIs/assignPrototypeAPIs in dist/utils.d.ts. Follow declarations under dist/features/ for comparable stock lifecycle signatures.
Pertanyaan umum
Kapan saya tidak perlu membuat fitur kustom?
Skill menyatakan jika perilakunya hanya meneruskan callback atau data renderer, sebaiknya pakai meta bertipe.
Apakah deklarasi tipe fitur otomatis memasang perilakunya?
Tidak. Skill menyatakan deklarasi saja tidak memasang apa pun, sehingga implementasi runtime harus sesuai dengan tipenya.
Di mana plugin harus didaftarkan?
Lewat pemanggilan tableFeatures, agar inferensi tipe dan komposisi menyertakannya.
Detail
Deskripsi asli dari pembuat
Implement a Table v9 plugin when built-ins and typed meta are insufficient. Covers FeatureMaps, runtime lifecycle hooks, prototypes, and a complete checked example.
repo: TanStack/table
Popularitas
- Bintang GitHub
- 29k
- Peringkat
- #9835
- Lisensi
- MIT
- Diperbarui
- 21/10/2026
Komentar
- …
Skill lain dari repositori ini
getting-started
29kMengajari agent Anda cara membuat dan menampilkan tabel data dengan TanStack Table di Alpine.js, mencakup pengaturan, data reaktif, dan rendering baris.
table-state
29kMengajari agent Anda cara membaca dan mengendalikan state tabel di Alpine.js, misalnya halaman yang sedang tampil, agar layar ikut berubah saat state itu berubah.
devtools
29kMengajari agent Anda cara mendaftarkan tabel Angular ke panel TanStack Devtools, sehingga pengembang dapat memeriksa setiap tabel saat membangun aplikasi.
getting-started
29kMengajari agent Anda cara membuat dan menampilkan tabel TanStack di Angular, mencakup pengaturan injectTable, rendering template, dan pembaruan data baris.
Skill serupa
angular-developer
280kMembantu agent Anda membuat kode Angular dan memberi saran struktur proyek. Berguna saat memulai proyek baru, membuat komponen, atau meningkatkan performa.
frontend-a11y
280kMembantu agent Anda membuat antarmuka web dapat diakses semua orang. Memastikan website dan aplikasi berfungsi baik dengan screen reader dan navigasi keyboard.
frontend-patterns
280kMembuat agent Anda menerapkan pola modern dalam frontend. Mengoptimalkan performa, mengelola state, dan mengikuti praktik terbaik React dan Next.js.