Data
DataGrid
Sortable, filterable data table built on @tanstack/react-table.
Quick Preview
Name | Email | Role | Status |
|---|---|---|---|
| Alex Johnson | alex@example.com | Admin | active |
| Sam Lee | sam@example.com | Editor | active |
| Kim Park | kim@example.com | Viewer | inactive |
| Jordan Smith | jordan@example.com | Editor | active |
| Riley Wong | riley@example.com | Admin | active |
| Morgan Davis | morgan@example.com | Viewer | inactive |
6 of 6 rows
Installation
npm install @tanstack/react-table
// Copy fromsrc/components/data/DataGrid.tsx
Examples
Striped + compact
Name | Email | Role | Status |
|---|---|---|---|
| Alex Johnson | alex@example.com | Admin | active |
| Sam Lee | sam@example.com | Editor | active |
| Kim Park | kim@example.com | Viewer | inactive |
| Jordan Smith | jordan@example.com | Editor | active |
| Riley Wong | riley@example.com | Admin | active |
| Morgan Davis | morgan@example.com | Viewer | inactive |
6 of 6 rows
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
| Prop | Type | Default | Description |
|---|---|---|---|
data* | TData[] | - | Array of row data |
columns* | ColumnDef<TData>[] | - | Column definitions |
searchable | boolean | false | Show global search input |
searchPlaceholder | string | 'Searchβ¦' | Search input placeholder |
striped | boolean | false | Alternating row colors |
compact | boolean | false | Reduced row padding |
className | string | - | Additional CSS classes |