data-tables
Skill3 starsChanged 6 months agoMITView on GitHub
Use when building data tables — sorting, filtering, pagination, row selection and bulk actions with TanStack Table + shadcn/ui, plus the loading, empty, and error states tables almost always forget.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- neurawork-git/n8n-autopilottheir own version, first seen Oct 1, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- neurawork-git/n8n-autopilot★ 18same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository14 other files it gives its agents.
- accessible-componentsSkill
- auth-screensSkill
- billing-and-pricingSkill
- component-architectureSkill
- dashboard-layoutSkill
- design-tokens-themingSkill
- empty-and-loading-statesSkill
- forms-and-validationSkill
- modals-and-dialogsSkill
- navigation-patternsSkill
- notifications-and-toastsSkill
- onboarding-flowsSkill
- responsive-layoutSkill
- settings-pagesSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 89
When table.getSelectedRowModel().rows.length > 0, show an action bar:
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Data Tables
Overview
Tables are where SaaS apps live (users, invoices, logs). Build them with TanStack Table (headless logic: sorting, filtering, pagination, selection) rendered through shadcn/ui Table primitives. Separate column definitions from the table shell so every table in the app behaves consistently.
When to use
- Displaying lists of records with sort/filter/paginate.
- Bulk actions on selected rows.
- A
<table>is being hand-built with manual sort state.
Column definitions
import { ColumnDef } from "@tanstack/react-table";
import { Checkbox } from "@/components/ui/checkbox";
import { Badge } from "@/components/ui/badge";
export type Invoice = { id: string; customer: string; status: "paid" | "open" | "void"; amount: number };
export const columns: ColumnDef<Invoice>[] = [
{
id: "select",
header: ({ table }) => (
<Checkbox
checked={table.getIsAllPageRowsSelected()}
onCheckedChange={(v) => table.toggleAllPageRowsSelected(!!v)}
aria-label="Select all"
/>
),
cell: ({ row }) => (
<Checkbox
checked={row.getIsSelected()}
onCheckedChange={(v) => row.toggleSelected(!!v)}
aria-label="Select row"
/>
),
enableSorting: false,
},
{ accessorKey: "customer", header: "Customer" },
{
accessorKey: "status",
header: "Status",
cell: ({ row }) => <Badge variant={row.original.status === "paid" ? "success" : "secondary"}>{row.original.status}</Badge>,
},
{
accessorKey: "amount",
header: () => <div className="text-right">Amount</div>,
cell: ({ row }) => <div className="text-right tabular-nums">${(row.original.amount / 100).toFixed(2)}</div>,
},
];The reusable shell
const table = useReactTable({
data, columns,
getCoreRowModel: getCoreRowModel(),
getSortedRowModel: getSortedRowModel(),
getPaginationRowModel: getPaginationRowModel(),
getFilteredRowModel: getFilteredRowModel(),
state: { sorting, rowSelection, globalFilter },
onSortingChange: setSorting,
onRowSelectionChange: setRowSelection,
});Render header/body from table.getHeaderGroups() / table.getRowModel().rows. Always handle the three non-happy states:
{isLoading ? (
<TableRow><TableCell colSpan={columns.length}><Skeleton className="h-8 w-full" /></TableCell></TableRow>
) : rows.length === 0 ? (
<TableRow><TableCell colSpan={columns.length} className="h-24 text-center text-muted-foreground">No results.</TableCell></TableRow>
) : (
rows.map((row) => <TableRow key={row.id} data-state={row.getIsSelected() && "selected"}>…</TableRow>
)}Bulk actions
When table.getSelectedRowModel().rows.length > 0, show an action bar:
{selectedCount > 0 && (
<div className="flex items-center gap-2 rounded-md border bg-muted/50 px-3 py-2 text-sm">
<span>{selectedCount} selected</span>
<Button size="sm" variant="destructive" onClick={deleteSelected}>Delete</Button>
</div>
)}Server-side at scale
For large datasets, set manualPagination/manualSorting/manualFiltering: true and pass state to your API. Keep filter/sort/page in the URL (searchParams) so views are shareable and survive refresh.
Pitfalls
- No loading/empty/error states — the #1 omission; a blank table looks broken.
- Right-align numbers +
tabular-nums— left-aligned currency is hard to scan. - Client-paginating 50k rows — move to server-side; don't ship it all.
- Selection lost on page change unless you key it by row id.
- Non-accessible sort headers — make them
<button>s witharia-sort. - Filter/sort only in component state — put it in the URL for shareable views.
Hand-off
A consistent table that pairs with empty-and-loading-states (skeletons), modals-and-dialogs (row edit/confirm), and notifications-and-toasts (bulk-action feedback).
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

