Components
Data Table
A feature-rich data grid built on top of Table primitives supporting sorting, global search filtering, row selection, and pagination out of the box.
The DataTable component simplifies rendering dynamic tabular datasets with search filtering, column sorting, pagination controls, and row selection.
Usage
import { DataTable, type ColumnDef } from "@/components/ui/data-table";
interface User {
id: string;
name: string;
email: string;
}
const users: User[] = [
{ id: "1", name: "Alice", email: "alice@example.com" },
{ id: "2", name: "Bob", email: "bob@example.com" },
];
const columns: ColumnDef<User>[] = [
{ id: "name", header: "Name", cell: ({ row }) => row.name, sortable: true, accessorKey: "name" },
{ id: "email", header: "Email", cell: ({ row }) => row.email, sortable: true, accessorKey: "email" },
];
export function ExampleDataTable() {
return (
<DataTable
data={users}
columns={columns}
searchable
enableSelection
pageSize={10}
/>
);
}Preview
| PAY-001 | success | ken99@yahoo.com | 2026-07-28 | $316.00 | |
| PAY-002 | success | Abe45@gmail.com | 2026-07-29 | $242.00 | |
| PAY-003 | processing | Monserrat44@gmail.com | 2026-07-30 | $837.00 | |
| PAY-004 | success | Silas22@gmail.com | 2026-07-31 | $874.00 |
Showing 1-4 of 7 items
Page 1 of 2
Features
- Global Search: Instant text filtering across all columns.
- Column Sorting: Toggle ascending / descending sort orders with headers.
- Row Selection: Checkbox selection for individual rows or all items.
- Pagination: Easy multi-page navigation controls with configurable page sizes.