๐ŸŽฏ Nexus teaches Next.js from foundations to professional systemsโ€ขโšก App Router, React 19, and Tailwind v4 in one learning pathโ€ข๐Ÿงฉ Inspect real components, layouts, and reusable patternsโ€ข๐Ÿ› ๏ธ Build production discipline, not just polished demosโ€ข๐Ÿ“š Tracks, references, and design studies in one placeโ€ข๐ŸŽฏ Nexus teaches Next.js from foundations to professional systemsโ€ขโšก App Router, React 19, and Tailwind v4 in one learning pathโ€ข๐Ÿงฉ Inspect real components, layouts, and reusable patternsโ€ข๐Ÿ› ๏ธ Build production discipline, not just polished demosโ€ข๐Ÿ“š Tracks, references, and design studies in one placeโ€ข๐ŸŽฏ Nexus teaches Next.js from foundations to professional systemsโ€ขโšก App Router, React 19, and Tailwind v4 in one learning pathโ€ข๐Ÿงฉ Inspect real components, layouts, and reusable patternsโ€ข๐Ÿ› ๏ธ Build production discipline, not just polished demosโ€ข๐Ÿ“š Tracks, references, and design studies in one placeโ€ข๐ŸŽฏ Nexus teaches Next.js from foundations to professional systemsโ€ขโšก App Router, React 19, and Tailwind v4 in one learning pathโ€ข๐Ÿงฉ Inspect real components, layouts, and reusable patternsโ€ข๐Ÿ› ๏ธ Build production discipline, not just polished demosโ€ข๐Ÿ“š Tracks, references, and design studies in one placeโ€ข
UI

DataTable

Sortable, paginated data tables powered by @tanstack/react-table.

Preview

IDโ‡…Nameโ‡…EmailRoleโ‡…Statusโ‡…
1Alice Johnsonalice@example.comAdminActive
2Bob Smithbob@example.comEditorActive
3Carol Whitecarol@example.comViewerInactive
4David Leedavid@example.comEditorActive
5Eva Martinezeva@example.comAdminActive
Page 1 of 2 ยท 8 rows

Installation

npm install @tanstack/react-table

Usage

import { createColumnHelper } from '@tanstack/react-table'
import { DataTable } from '@/components/ui/DataTable'
interface User { id: number; name: string; email: string; role: string }
const columnHelper = createColumnHelper<User>()
const columns = [
columnHelper.accessor('id', { header: 'ID' }),
columnHelper.accessor('name', { header: 'Name' }),
columnHelper.accessor('email', { header: 'Email', enableSorting: false }),
columnHelper.accessor('role', { header: 'Role' }),
]
const data: User[] = [
{ id: 1, name: 'Alice Johnson', email: 'alice@example.com', role: 'Admin' },
// ...
]
export default function Page() {
return <DataTable columns={columns} data={data} pageSize={5} />
}

Variants

Striped & Bordered

IDโ‡…Nameโ‡…EmailRoleโ‡…Statusโ‡…
1Alice Johnsonalice@example.comAdminActive
2Bob Smithbob@example.comEditorActive
3Carol Whitecarol@example.comViewerInactive
4David Leedavid@example.comEditorActive
5Eva Martinezeva@example.comAdminActive
Page 1 of 2 ยท 8 rows

Compact (no pagination)

IDโ‡…Nameโ‡…EmailRoleโ‡…Statusโ‡…
1Alice Johnsonalice@example.comAdminActive
2Bob Smithbob@example.comEditorActive
3Carol Whitecarol@example.comViewerInactive
4David Leedavid@example.comEditorActive

Prompt Preview

Copy a prompt that recreates this UI

Paste this into your AI coding assistant to generate code that closely matches the reference, including color, size, shape, typography, spacing, and polish.

Copy-ready AI prompt

Starts from the current visual reference and project constraints.

Tweak only product-specific copy or data after the first generation pass.

Props

PropTypeDefaultDescription
columns*ColumnDef<TData>[]-Column definitions from @tanstack/react-table
data*TData[]-Array of row data objects
pageSizenumber10Number of rows per page
showPaginationbooleantrueShow pagination controls
stripedbooleanfalseAlternate row background colors
borderedbooleanfalseAdd border around the table
compactbooleanfalseReduce cell padding for dense display
classNamestring-Extra CSS classes for the wrapper
โ† Back to UI Components