BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/tablecn/data-table

Data Table

tablecn/data-table
FreeComponent

A feature-rich data table component with server-side filtering, sorting, and pagination

Install it

npx shadcn@latest add https://tablecn.com/r/data-table.json

Source

src/components/data-table/data-table.tsxtablecn.com/r/data-table.json
1import { flexRender, type Table as TanstackTable } from "@tanstack/react-table";
2import type * as React from "react";
3
4import { DataTablePagination } from "@/components/data-table/data-table-pagination";
5import {
6 Table,
7 TableBody,
8 TableCell,
9 TableHead,
10 TableHeader,
11 TableRow,
12} from "@/components/ui/table";
13import { getColumnPinningStyle } from "@/lib/data-table";
14import { cn } from "@/lib/utils";
15
16interface DataTableProps<TData> extends React.ComponentProps<"div"> {
17 table: TanstackTable<TData>;
18 actionBar?: React.ReactNode;
19}
20
21export function DataTable<TData>({
22 table,
23 actionBar,
24 children,
25 className,
26 ...props
27}: DataTableProps<TData>) {
28 return (
29 <div
30 className={cn("flex w-full flex-col gap-2.5 overflow-auto", className)}
31 {...props}
32 >
33 {children}
34 <div className="overflow-hidden rounded-md border">
35 <Table>
36 <TableHeader>
37 {table.getHeaderGroups().map((headerGroup) => (
38 <TableRow key={headerGroup.id}>
39 {headerGroup.headers.map((header) => (
40 <TableHead
41 key={header.id}
42 colSpan={header.colSpan}
43 style={{
44 ...getColumnPinningStyle({ column: header.column }),
45 }}
46 >
47 {header.isPlaceholder
48 ? null
49 : flexRender(
50 header.column.columnDef.header,
51 header.getContext(),
52 )}
53 </TableHead>
54 ))}
55 </TableRow>
56 ))}
57 </TableHeader>
58 <TableBody>
59 {table.getRowModel().rows?.length ? (
60 table.getRowModel().rows.map((row) => (
61 <TableRow
62 key={row.id}
63 data-state={row.getIsSelected() && "selected"}
64 >
65 {row.getVisibleCells().map((cell) => (
66 <TableCell
67 key={cell.id}
68 style={{
69 ...getColumnPinningStyle({ column: cell.column }),
70 }}
71 >
72 {flexRender(
73 cell.column.columnDef.cell,
74 cell.getContext(),
75 )}
76 </TableCell>
77 ))}
78 </TableRow>
79 ))
80 ) : (
81// … truncated

What it pulls in

npm packages

  • @tanstack/react-table
  • lucide-react
  • nuqs

Other registry items

  • badge
  • button
  • calendar
  • command
  • dropdown-menu
  • input
  • popover
  • select
  • separator
  • slider
  • table

Files it writes

  • src/components/data-table/data-table.tsx
  • src/components/data-table/data-table-column-header.tsx
  • src/components/data-table/data-table-pagination.tsx
  • src/components/data-table/data-table-view-options.tsx
  • src/components/data-table/data-table-faceted-filter.tsx
  • src/components/data-table/data-table-toolbar.tsx
  • src/components/data-table/data-table-slider-filter.tsx
  • src/components/data-table/data-table-date-filter.tsx
  • src/components/data-table/data-table-skeleton.tsx
  • src/hooks/use-callback-ref.ts
  • src/hooks/use-data-table.ts
  • src/hooks/use-debounced-callback.ts
  • src/lib/data-table.ts
  • src/lib/format.ts
  • src/lib/parsers.ts
  • src/config/data-table.ts
  • src/types/data-table.ts

Facts

Registry
tablecn
Type
registry:component
Access
Free
Files written
17
Licence
MIT
First indexed
2026-08-02
Last confirmed
today

Go to the source

tablecn.com sadmann7/tablecn on GitHub Raw registry item This item as JSON

More from tablecn

All 13 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Data Griddata-gridtablecnComponentsFree4 deps · 21 files
Data Grid Filter Menudata-grid-filter-menutablecnComponentsFree2 deps · 8 files
Data Grid Keyboard Shortcutsdata-grid-keyboard-shortcutstablecnComponentsFree1 dep · 2 files
Data Grid Row Height Menudata-grid-row-height-menutablecnComponentsFree2 deps
Data Grid Select Columndata-grid-select-columntablecnComponentsFree1 dep
Data Grid Skeletondata-grid-skeletontablecnComponentsFreeno deps
Data Grid Sort Menudata-grid-sort-menutablecnComponentsFree2 deps · 4 files
Data Grid View Menudata-grid-view-menutablecnComponentsFree2 deps · 2 files
BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex