Data Table
Sorting, filtering, pagination, row selection, and column visibility powered by TanStack Table v8. Explore five working examples.
Installation
Install Data Table in your project.
npx binhlaig-ui@latest add data-tableFor project setup, installer selection, dependencies, and advanced installation instructions, see the Installation Guide.
View Installation Guide →Update or Overwrite →Install Pagination
These tables use Binhlaig UI Pagination for page navigation. Install it alongside Data Table.
npx binhlaig-ui@latest add paginationImport
import { DataTable, DataTableSortButton } from "@/components/ui/data-table"1. Payments
The original example: email filtering, amount display, sorting, and selectable rows.
Columns
| Status | Amount | ||
|---|---|---|---|
| Paid | ada@example.com | $249.00 | |
| Pending | lin@example.com | $125.00 |
Selected rows 0 / 3Page 1 / 2
2. Product inventory
Search products, sort stock counts, and display five products per page. Stock badges indicate low or empty stock.
| Product | SKU | Price (MMK) | |
|---|---|---|---|
| Rice 5 kg | RICE-05 | 42 | 18000 MMK |
| Cooking oil | OIL-01 | 8 | 12000 MMK |
| Coffee | COF-01 | Out of stock | 6500 MMK |
| Milk | MILK-01 | 24 | 3500 MMK |
| Tea | TEA-01 | 5 | 2800 MMK |
Total 7 · Page 1 / 2
3. Staff selection
Select staff with checkboxes, keep stable row IDs across pages, and toggle optional columns.
Select individual staff or all rows on the current page. Use Columns to hide optional fields.
Columns
| Staff ID | Name | Role | Status | |
|---|---|---|---|---|
| ST-001 | Aung Aung | Manager | Active | |
| ST-002 | Su Su | Cashier | Active | |
| ST-003 | Hla Hla | Cashier | Inactive | |
| ST-004 | Min Min | Kitchen | Active | |
| ST-005 | May May | Service | Active |
Selected rows 0 / 6Page 1 / 2
4. Order filters and details
Filter orders by status, search by customer, and open an order's detail panel.
Columns
| Order | Customer | Status | Details | |
|---|---|---|---|---|
| ORD-001 | Aung Aung | Pending | 18500 | |
| ORD-002 | Su Su | Completed | 32000 |
Selected rows 0 / 4Page 1 / 2
5. Inline task updates
Change task status using a select input. The completed count updates immediately.
Completed tasks — 1 / 4
Columns
| ID | Task | Assignee | Update status |
|---|---|---|---|
| TASK-01 | Check stock | Aung Aung | |
| TASK-02 | Prepare labels | Su Su | |
| TASK-03 | Clean counter | Min Min |
Selected rows 0 / 4Page 1 / 2
Demo changes are stored in this page's React state and reset on refresh.