getting-started
Skill này làm gì
Skill này chỉ cách xây dựng một bảng dữ liệu trong ứng dụng Octane bằng TanStack Table. Skill dành cho lập trình viên dùng Octane và cú pháp template TSRX.
Khi nào nên dùng
- ✓Khi bạn đang xây dựng một trang Octane hiển thị danh sách các bản ghi trong bảng.
- ✓Khi bạn cần bảng hiển thị tiêu đề và ô qua helper render của nó.
- ✓Khi bạn muốn định nghĩa các cột của bảng bằng một helper cột trong file TSRX.
Liên kết skill
https://github.com/TanStack/table/blob/main/packages/octane-table/skills/getting-started/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Tôi đang xây dựng một trang Octane hiển thị danh sách sản phẩm trong bảng. Tôi thiết lập nó như thế nào?”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Skill đưa ra một component mẫu có các cột và dữ liệu, rồi lặp qua các tiêu đề, hàng và ô trong markup để hiển thị trên trang.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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-featuresand 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/.
Câu hỏi thường gặp
TSRX là gì?
Các ví dụ được viết bằng TSRX, cú pháp component mà adapter này dùng, nên trông khác với JSX thông thường.
Bảng lấy dữ liệu từ đâu?
Ví dụ giữ dữ liệu trong state của Octane bằng useState và truyền nó cho bảng.
Điều này có thay thế hướng dẫn bảng cốt lõi không?
Không. Nó giả định bạn đã đọc hướng dẫn cốt lõi về mô hình bảng không giao diện (headless) trước.
Chi tiết
Mô tả gốc của tác giả
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
Độ phổ biến
- Sao GitHub
- 29k
- Vị trí xếp hạng
- #9817
- Giấy phép
- MIT
- Cập nhật
- 21/10/2026
Bình luận
- …
Thêm skill từ kho mã này
getting-started
29kHướng dẫn agent của bạn cách tạo và hiển thị bảng dữ liệu với TanStack Table trong Alpine.js, gồm thiết lập, dữ liệu phản ứng và hiển thị các hàng.
table-state
29kHướng dẫn agent của bạn cách đọc và điều khiển trạng thái bảng trong Alpine.js, như trang hiện tại, để màn hình cập nhật khi trạng thái đó thay đổi.
devtools
29kHướng dẫn agent của bạn cách đăng ký bảng Angular với bảng điều khiển TanStack Devtools, để lập trình viên có thể kiểm tra từng bảng trong khi xây dựng ứng dụng.
getting-started
29kHướng dẫn agent của bạn cách tạo và hiển thị bảng TanStack trong Angular, gồm thiết lập injectTable, hiển thị trong template và cập nhật dữ liệu hàng.
Skill tương tự
angular-developer
280kGiúp agent của bạn viết code Angular và tư vấn cấu trúc dự án, hữu ích khi bắt đầu dự án mới hoặc cải thiện hiệu suất.
frontend-a11y
280kGiúp agent của bạn làm cho giao diện web dễ tiếp cận với mọi người. Đảm bảo website và ứng dụng hoạt động tốt với trình đọc màn hình và điều hướng bằng bàn phím.
frontend-patterns
280kGiúp agent của bạn áp dụng các mẫu hiện đại trong phát triển frontend. Tối ưu hiệu năng, quản lý trạng thái và tuân theo thực hành tốt nhất với React và Next.js.