- Docs
- Components
- Data display
Table
The one way to show records. Columns and rows in; sorting, selection, row actions and every state built in.
- Import
- @qeetrix/react
- Status
- StableSince 0.0.2
- Renders
<table>Server-rendered- Tested
- WCAG 2.2 AAaxe on every pull request
01
Playground
Every prop, live, and the code it takes.
| Status | MFA | ||
|---|---|---|---|
Priya Sharmapriya@acme.in | Active | Passkey | 2 minutes ago |
Rahul Vermarahul.verma@acme.in | Active | Passkey | 18 minutes ago |
Ananya Iyerananya@acme.in | Active | Authenticator | 1 hour ago |
Karthik Reddykarthik.r@acme.in | Invited | — | 3 hours ago |
import { Table, type TableSort } from "@qeetrix/react";
const [sort, setSort] = useState<TableSort | null>({ column: "lastSignIn", direction: "descending" });
<Table
label="Users"
rows={users}
rowId={(row) => row.id}
rowLabel={(row) => row.name}
columns={columns}
sort={sort}
onSortChange={setSort}
/>02
Rows of records
label, rows, rowId, rowLabel and columns: each column an id, a header and a cell.
| Name | Status | MFA | Last sign-in |
|---|---|---|---|
Priya Sharmapriya@acme.in | Active | Passkey | 2 minutes ago |
Rahul Vermarahul.verma@acme.in | Active | Passkey | 18 minutes ago |
Ananya Iyerananya@acme.in | Active | Authenticator | 1 hour ago |
Karthik Reddykarthik.r@acme.in | Invited | — | 3 hours ago |
const columns: TableColumn<User>[] = [
{ id: "name", header: "Name", cell: (row) => <AvatarItem name={row.name} description={row.email} /> },
{ id: "status", header: "Status", cell: (row) => <Badge tone={tone[row.status]}>{row.status}</Badge> },
{ id: "mfa", header: "MFA", cell: (row) => row.mfa },
{ id: "lastSignIn", header: "Last sign-in", align: "end", cell: (row) => formatRelativeTime(row.lastSignIn) },
];
<Table label="Users" rows={users} rowId={(row) => row.id} rowLabel={(row) => row.name} columns={columns} />03
Sorting
sortable: the header is a button. A click sorts one way, then the other, then back to the server's order; the rows arrive sorted.
| Status | MFA | ||
|---|---|---|---|
Priya Sharmapriya@acme.in | Active | Passkey | 2 minutes ago |
Rahul Vermarahul.verma@acme.in | Active | Passkey | 18 minutes ago |
Ananya Iyerananya@acme.in | Active | Authenticator | 1 hour ago |
Karthik Reddykarthik.r@acme.in | Invited | — | 3 hours ago |
Meera Nairmeera.nair@acme.in | Active | Passkey | yesterday |
const [sort, setSort] = useState<TableSort | null>({ column: "lastSignIn", direction: "descending" });
<Table rows={useUsers({ sort }).rows} sort={sort} onSortChange={setSort} … />
{ id: "lastSignIn", header: "Last sign-in", sortable: true, sortFirst: "descending", … }04
Selection
selectable: a checkbox per row, and the header's for the page. While any are chosen, a bar holds the count, bulkActions and Clear.
| Name | Status | MFA | Last sign-in | |
|---|---|---|---|---|
Priya Sharmapriya@acme.in | Active | Passkey | 2 minutes ago | |
Rahul Vermarahul.verma@acme.in | Active | Passkey | 18 minutes ago | |
Ananya Iyerananya@acme.in | Active | Authenticator | 1 hour ago | |
Karthik Reddykarthik.r@acme.in | Invited | — | 3 hours ago |
<Table
selectable
bulkActions={(ids) => (
<>
<Button variant="soft" tone="neutral">Reset MFA</Button>
<Button variant="soft" tone="danger">Suspend</Button>
</>
)}
…
/>05
Opening a row
renderRowLink or rowHref: the first column's cell is the row's link, and a click anywhere else on the row follows it. rowActions: a menu at its end.
| Name | Status | MFA | Last sign-in | Actions |
|---|---|---|---|---|
Priya Sharmapriya@acme.in | Active | Passkey | 2 minutes ago | |
Rahul Vermarahul.verma@acme.in | Active | Passkey | 18 minutes ago | |
Ananya Iyerananya@acme.in | Active | Authenticator | 1 hour ago | |
Karthik Reddykarthik.r@acme.in | Invited | — | 3 hours ago |
<Table
renderRowLink={(row) => <Link to="/users/$id" params={{ id: row.id }} />}
rowActions={(row) => (
<>
<MenuItem>View profile</MenuItem>
<MenuItem>Reset MFA</MenuItem>
<MenuSeparator />
<MenuItem tone="danger">Suspend</MenuItem>
</>
)}
…
/>06
Amounts
numeric: tabular figures, end-aligned, so the digits line up.
| Invoice | Customer | Issued | Amount |
|---|---|---|---|
| INV-2026-0412 | Acme Pvt Ltd | 1 Oct 2026 | ₹1,24,500.00 |
| INV-2026-0413 | Globex India | 8 Oct 2026 | ₹8,250.00 |
| INV-2026-0414 | Initech Labs | 15 Oct 2026 | ₹10,48,000.00 |
{ id: "amount", header: "Amount", numeric: true, cell: (row) => formatCurrency(row.amount, "INR") }07
Loading, empty and error
In the table, under its header: placeholder rows while the first page loads; empty and error in their place.
| Name | Status | Last sign-in |
|---|
| Name | Status | Last sign-in |
|---|
| Name | Status | Last sign-in |
|---|
<Table rows={[]} loading … />
<Table rows={[]} empty={<EmptyState size="section" title="No users yet" … />} … />
<Table rows={[]} error={<DataState error={error} onRetry={refetch} />} … />08
Refreshing
loading with rows on show: they stay readable, a busy line runs under the header, and Loading is announced.
| Name | Status | Last sign-in |
|---|---|---|
Priya Sharmapriya@acme.in | Active | 2 minutes ago |
Rahul Vermarahul.verma@acme.in | Active | 18 minutes ago |
Ananya Iyerananya@acme.in | Active | 1 hour ago |
<Table rows={users} loading={isFetching} … />09
In a card
A Table as a Card's body runs edge to edge: the toolbar above, Pagination in the footer.
| Name | Status | MFA | Last sign-in | Actions | |
|---|---|---|---|---|---|
Priya Sharmapriya@acme.in | Active | Passkey | 2 minutes ago | ||
Rahul Vermarahul.verma@acme.in | Active | Passkey | 18 minutes ago | ||
Ananya Iyerananya@acme.in | Active | Authenticator | 1 hour ago | ||
Karthik Reddykarthik.r@acme.in | Invited | — | 3 hours ago | ||
Meera Nairmeera.nair@acme.in | Active | Passkey | yesterday |
<Card footer={<Pagination offset={offset} pageSize={25} total={1284} onOffsetChange={setOffset} />}>
<Table
toolbar={<SearchField aria-label="Search users" placeholder="Search by name or email" />}
selectable
bulkActions={bulkActions}
rowActions={rowActions}
…
/>
</Card>