A powerful data grid component built on top of TanStack Table v8 with features like sorting, filtering, pagination, and drag & drop support.
"use client"
import { useMemo, useState } from "react"pnpm dlx shadcn@latest add @blitz-ui/data-grid
import {
DataGrid,
DataGridContainer,
DataGridPagination,
DataGridTable,
} from "@/components/blitz-ui/r-data-grid/data-grid"const table = useReactTable({
data,
columns,
getCoreRowModel: getCoreRowModel(),
})
return (
<DataGrid table={table} recordCount={data.length}>
<DataGridContainer>
<DataGridTable />
</DataGridContainer>
<DataGridPagination />
</DataGrid>
)Component p-data-grid-23 not found in registry.
The root component that provides the table context.
| Prop | Type | Default | Description |
|---|---|---|---|
table | Table<TData> | - | Required. The TanStack Table instance. |
recordCount | number | - | Required. Total number of records. |
isLoading | boolean | false | Whether the table is in a loading state. |
loadingMode | "skeleton" | "spinner" | "skeleton" | The visual style of the loading state. |
loadingMessage | ReactNode | string | "Loading..." | Message to display when loadingMode is "spinner". |
emptyMessage | ReactNode | string | "No data available" | Message to display when the table is empty. |
onRowClick | (row: TData) => void | - | Callback function triggered when a row is clicked. |
tableLayout | DataGridTableLayout | - | Configuration for table layout and features. |
tableClassNames | DataGridTableClassNames | - | Custom CSS classes for various table parts. |
className | string | - | Additional CSS classes for the root grid component. |
Configuration object for the table's behavior and appearance.
| Property | Type | Default | Description |
|---|---|---|---|
dense | boolean | false | Whether to use dense padding for cells. |
cellBorder | boolean | false | Whether to show vertical borders between cells. |
rowBorder | boolean | true | Whether to show horizontal borders between rows. |
rowRounded | boolean | false | Whether to add rounded corners to rows. |
stripped | boolean | false | Whether to use zebra-striping for rows. |
headerBackground | boolean | true | Whether to show a background color for the header. |
headerBorder | boolean | true | Whether to show a border below the header. |
headerSticky | boolean | false | Whether the header should be sticky during scroll. |
width | "auto" | "fixed" | "fixed" | The table layout algorithm (table-auto vs table-fixed). |
columnsVisibility | boolean | false | Enables column visibility toggling. |
columnsResizable | boolean | false | Enables column resizing. |
columnsPinnable | boolean | false | Enables column pinning. |
columnsMovable | boolean | false | Enables moving columns via menu. |
columnsDraggable | boolean | false | Enables drag-and-drop for columns. |
rowsDraggable | boolean | false | Enables drag-and-drop for rows. |
Custom CSS classes for different parts of the table.
| Property | Type | Default | Description |
|---|---|---|---|
base | string | - | CSS classes for the <table> element. |
header | string | - | CSS classes for the <thead> element. |
headerRow | string | - | CSS classes for header rows. |
headerSticky | string | - | CSS classes for sticky header state. |
body | string | - | CSS classes for the <tbody> element. |
bodyRow | string | - | CSS classes for body rows. |
footer | string | - | CSS classes for the <tfoot> element. |
edgeCell | string | - | CSS classes for the first and last cells in a row. |
A scrollable container for the table.
| Prop | Type | Default | Description |
|---|---|---|---|
border | boolean | true | Whether to show a border around the container. |
className | string | - | Additional CSS classes for the container. |
The component that renders the actual HTML table. It automatically handles data rendering, loading states (skeletons/spinners), and empty states based on the parent DataGrid configuration.
The component for table pagination controls.
| Prop | Type | Default | Description |
|---|---|---|---|
sizes | number[] | [5, 10, 25, 50, 100] | Array of available page sizes. |
sizesLabel | string | "Show" | Label for the page size selector. |
sizesDescription | string | "per page" | Description following the page size selector. |
rowsPerPageLabel | string | "Rows per page" | Accessible label for the rows per page selector. |
info | string | "{from} - {to} of {count}" | Template for displaying record info. |
more | boolean | false | Whether to show ellipsis for more pages. |
moreLimit | number | 5 | The number of page buttons to show before truncating. |
previousPageLabel | string | "Go to previous page" | Accessible label for the previous page button. |
nextPageLabel | string | "Go to next page" | Accessible label for the next page button. |
ellipsisText | string | "..." | Text to display for the ellipsis button. |
className | string | - | Additional CSS classes for the pagination container. |
A flexible column header component with built-in support for sorting, pinning, and moving columns.
| Prop | Type | Default | Description |
|---|---|---|---|
column | Column<TData, TValue> | - | Required. The TanStack Column instance. |
title | string | - | The title to display in the header. |
icon | ReactNode | - | Optional icon to display next to the title. |
filter | ReactNode | - | Optional filter component to display in the header menu. |
visibility | boolean | false | Whether to include column visibility controls in the menu. |
A popover-based multi-select filter for columns.
| Prop | Type | Default | Description |
|---|---|---|---|
column | Column<TData, TValue> | - | The TanStack Column instance to filter. |
title | string | - | The title for the filter trigger and placeholder. |
options | Array<{ label: string, value: string, icon?: ComponentType }> | - | Required. The list of options to filter by. |
A dropdown component to toggle column visibility.
| Prop | Type | Default | Description |
|---|---|---|---|
table | Table<TData> | - | Required. The TanStack Table instance. |
trigger | ReactElement | - | Required. The trigger element for the visibility menu. |
Used for enabling column drag-and-drop reordering.
| Prop | Type | Default | Description |
|---|---|---|---|
handleDragEnd | (event: DragEndEvent) => void | - | Required. Callback triggered when a column drag operation ends. |
Used for enabling row drag-and-drop reordering.
| Prop | Type | Default | Description |
|---|---|---|---|
dataIds | UniqueIdentifier[] | - | Required. Array of unique identifiers for the current page data. |
handleDragEnd | (event: DragEndEvent) => void | - | Required. Callback triggered when a row drag operation ends. |
On This Page
| Name | Location | Balance ($) | |
|---|---|---|---|
| Sarah Chen | United Kingdom | $5243.03 | |
| Nick Johnson | France | $5943.03 | |
| Michael Rodriguez | Canada | $5343.03 | |
| Maria Garcia | Japan | $5843.03 | |
| Liam Thompson | Italy | $6043.03 |
| Name | Company | Occupation | Salary |
|---|---|---|---|
SC Sarah Chen sarah@example.com | OpenAI | CTO | $5243.03 |
NJ Nick Johnson nick@example.com | LVMH | Data Scientist | $5943.03 |
MR Michael Rodriguez michael@example.com | Meta | Designer | $5343.03 |
MG Maria Garcia maria@example.com | Sony | Marketing Lead | $5843.03 |
LT Liam Thompson liam@example.com | ENI | Engineer | $6043.03 |
| Name | Location | Balance ($) | |
|---|---|---|---|
| sarah@example.com | United Kingdom | $5243.03 | |
| nick@example.com | France | $5943.03 | |
| michael@example.com | Canada | $5343.03 | |
| maria@example.com | Japan | $5843.03 | |
| liam@example.com | Italy | $6043.03 |
| Name | Location | Status |
|---|---|---|
SC Sarah Chen sarah@openai.com | United Kingdom | Pending |
SC Sarah Chen sarah@tata.in | India | Approved |
NJ Nick Johnson nick@lvmh.fr | France | Approved |
MR Michael Rodriguez michael@meta.com | Canada | Approved |
MG Maria Garcia maria@sony.jp | Japan | Approved |
| Name | Location | Balance ($) | |
|---|---|---|---|
| sarah@openai.com | United Kingdom | $4321.87 | |
| sarah@tata.in | India | $4521.67 | |
| nick@lvmh.fr | France | $7345.10 | |
| michael@meta.com | Canada | $7654.98 | |
| maria@sony.jp | Japan | $8452.39 |
| Name | Location | Joined | |
|---|---|---|---|
| sarah@openai.com | United Kingdom | Jul, 2025 | |
| sarah@tata.in | India | Mar, 2020 | |
| nick@lvmh.fr | France | Sep, 2019 | |
| michael@meta.com | Canada | Mar, 2019 | |
| maria@sony.jp | Japan | Oct, 2020 |
| Name | Location | Joined | |
|---|---|---|---|
SC Sarah Chen sarah@openai.com | United Kingdom | Jul, 2020 | |
SC Sarah Chen sarah@tata.in | India | Mar, 2020 | |
NJ Nick Johnson nick@lvmh.fr | France | Sep, 2019 | |
MR Michael Rodriguez michael@meta.com | Canada | Mar, 2019 | |
MG Maria Garcia maria@sony.jp | Japan | Oct, 2020 |
| Name | Location | Status | ||
|---|---|---|---|---|
| sarah@openai.com | United Kingdom | Pending | ||
| sarah@tata.in | India | Approved | ||
| nick@lvmh.fr | France | Pending | ||
| michael@meta.com | Canada | Approved | ||
| maria@sony.jp | Japan | Approved |
AJ Alex Johnson alex@example.com | $459.97 | Shipped | 12 items | |
SC Sarah Chen sarah@example.com | $249.48 | Processing | 4 items | |
MR Michael Rodriguez michael@example.com | $189.97 | Delivered | 15 items | |
EW Emma Wilson emma@example.com | $299.97 | Cancelled | 10 items | |
DK David Kim david@example.com | $179.97 | Pending | 15 items |
User | Email | Location |
|---|---|---|
AJ Alex Johnson alex@apple.com | alex@apple.com | United States |
SC Sarah Chen sarah@openai.com | sarah@openai.com | United Kingdom |
MR Michael Rodriguez michael@meta.com | michael@meta.com | Canada |
EW Emma Wilson emma@tesla.com | emma@tesla.com | Australia |
DK David Kim david@sap.com | david@sap.com | Germany |
SC Sarah Chen sarah@openai.com | OpenAI | CTO | $4321.87 |
SC Sarah Chen sarah@tata.in | Tata | Sales Manager | $4521.67 |
NJ Nick Johnson nick@lvmh.fr | LVMH | Data Scientist | $7345.10 |
MR Michael Rodriguez michael@meta.com | Meta | Designer | $7654.98 |
MG Maria Garcia maria@sony.jp | Sony | Marketing Lead | $8452.39 |
| Status | |||
|---|---|---|---|
SC Sarah Chen sarah@openai.com | OpenAI | CTO | Pending |
SC Sarah Chen sarah@tata.in | Tata | Sales Manager | Approved |
NJ Nick Johnson nick@lvmh.fr | LVMH | Data Scientist | Approved |
MR Michael Rodriguez michael@meta.com | Meta | Designer | Approved |
MG Maria Garcia maria@sony.jp | Sony | Marketing Lead | Approved |
Name | Email | Status |
|---|---|---|
| sarah@openai.com | Pending | |
| sarah@tata.in | Approved | |
| nick@lvmh.fr | Pending | |
| michael@meta.com | Approved | |
| maria@sony.jp | Pending |
| Name | Location | ||
|---|---|---|---|
| alex@apple.com | United States | ||
| sarah@openai.com | United Kingdom | ||
| michael@meta.com | Canada | ||
| emma@tesla.com | Australia | ||
| david@sap.com | Germany | ||
| aron@keenthemes.com | Malaysia |
SC Sarah Chen sarah@openai.com | CTO OpenAI | Pending |
SC Sarah Chen sarah@tata.in | Sales Manager Tata | Approved |
NJ Nick Johnson nick@lvmh.fr | Data Scientist LVMH | Pending |
MR Michael Rodriguez michael@meta.com | Designer Meta | Approved |
MG Maria Garcia maria@sony.jp | Marketing Lead Sony | Approved |
| sarah@openai.com | United Kingdom | Pending | |
| sarah@tata.in | India | Approved | |
| nick@lvmh.fr | France | Pending | |
| michael@meta.com | Canada | Approved | |
| maria@sony.jp | Japan | Approved |
| Name | Role | Status |
|---|---|---|
SC Sarah Chen sarah@openai.com | CTO OpenAI | Pending |
SC Sarah Chen sarah@tata.in | Sales Manager Tata | Approved |
NJ Nick Johnson nick@lvmh.fr | Data Scientist LVMH | Pending |
MR Michael Rodriguez michael@meta.com | Designer Meta | Approved |
MG Maria Garcia maria@sony.jp | Marketing Lead Sony | Approved |
LT Liam Thompson liam@eni.it | Engineer ENI | Pending |
JB James Brown james@bbva.es | Product Manager BBVA | Pending |
EW Emma Wilson emma@tesla.com | Developer Tesla | Pending |
DK David Kim david@sap.com | Lawyer SAP | Approved |
AT Aron Thompson aron@keenthemes.com | Director Keenthemes | Approved |
SC Sarah Chen sarah@openai.com | sarah@openai.com | United Kingdom | Pending |
SC Sarah Chen sarah@tata.in | sarah@tata.in | India | Approved |
NJ Nick Johnson nick@lvmh.fr | nick@lvmh.fr | France | Pending |
MR Michael Rodriguez michael@meta.com | michael@meta.com | Canada | Approved |
MG Maria Garcia maria@sony.jp | maria@sony.jp | Japan | Approved |
SC Sarah Chen sarah@example.com | United Kingdom | Pending |
SC Sarah Chen sarah@example.com | India | Approved |
NJ Nick Johnson nick@example.com | France | Approved |
MR Michael Rodriguez michael@example.com | Canada | Approved |
MG Maria Garcia maria@example.com | Japan | Approved |
SC Sarah Chen sarah@openai.com | United Kingdom | Pending |
SC Sarah Chen sarah@tata.in | India | Approved |
NJ Nick Johnson nick@lvmh.fr | France | Approved |
MR Michael Rodriguez michael@meta.com | Canada | Approved |
MG Maria Garcia maria@sony.jp | Japan | Approved |
SC Sarah Chen sarah@openai.com | United Kingdom | CTO | Mar, 2023 | Inactive | ||
SC Sarah Chen sarah@tata.in | India | Sales Manager | Oct, 2024 | Approved | ||
NJ Nick Johnson nick@lvmh.fr | France | Data Scientist | Apr, 2022 | Pending | ||
MR Michael Rodriguez michael@meta.com | Canada | Designer | Jun, 2022 | Blocked | ||
MG Maria Garcia maria@sony.jp | Japan | Marketing Lead | Dec, 2023 | Blocked |