Skip to content

Data table

Sorting, filtering, selection and paging, on the client or the server.

In use

Drag a header edge (or focus it and use the arrow keys) to resize; double-click resets. The button at the end of the header row hides and reorders columns (drag a grip, or focus it and use the arrow keys; p95 starts hidden), Requests sorts descending first, and the layout is stored under storageKey.

gatewayPublic HTTP entryHealthyeu-central812,400
workerBackground jobsDegradedeu-central154,200
schedulerCron and timersHealthyus-east8,600
authSessions and tokensHealthyeu-central201,900
mailerOutbound emailPausedus-east0
searchFull-text indexHealthyap-south64,300
billingInvoices and usageFailingeu-central12,100
webhooksDelivery and retriesHealthyus-east31,800
8 of 8 services

Click a row to open it.

Variants

gatewayPublic HTTP entryHealthyeu-central812,40042 ms
workerBackground jobsDegradedeu-central154,200118 ms
schedulerCron and timersHealthyus-east8,6009 ms
authSessions and tokensHealthyeu-central201,90031 ms
mailerOutbound emailPausedus-east0–
searchFull-text indexHealthyap-south64,30087 ms
billingInvoices and usageFailingeu-central12,100410 ms
webhooksDelivery and retriesHealthyus-east31,80055 ms
8 of 8 compact services
gatewayPublic HTTP entry42 ms
workerBackground jobs118 ms
schedulerCron and timers9 ms
authSessions and tokens31 ms
mailerOutbound email–
searchFull-text index87 ms
billingInvoices and usage410 ms
webhooksDelivery and retries55 ms
8 of 8 missing values

States

No services yet

Services you create appear here with their health and traffic.

Filtering, loading and error

Type to filter and switch the table state. Selection survives filtering.

gatewayPublic HTTP entryHealthyeu-central812,40042 ms
workerBackground jobsDegradedeu-central154,200118 ms
schedulerCron and timersHealthyus-east8,6009 ms
authSessions and tokensHealthyeu-central201,90031 ms
mailerOutbound emailPausedus-east0–
searchFull-text indexHealthyap-south64,30087 ms
billingInvoices and usageFailingeu-central12,100410 ms
webhooksDelivery and retriesHealthyus-east31,80055 ms
8 of 8 services1 selected

Selection across filtering

Filtered to us-east with worker (eu-central) and webhooks selected: the header checkbox is mixed and acts on visible rows only.

schedulerCron and timersHealthyus-east8,6009 ms
mailerOutbound emailPausedus-east0–
webhooksDelivery and retriesHealthyus-east31,80055 ms
3 of 8 filtered services2 selected, 1 hidden by filter

Pages

Three rows per page. Selection survives paging.

gatewayPublic HTTP entryHealthyeu-central812,40042 ms
workerBackground jobsDegradedeu-central154,200118 ms
schedulerCron and timersHealthyus-east8,6009 ms
8 of 8 services

Server data

With manual a fake loader answers after 400 ms; the filter debounces by 200 ms.

Code
import { DataTable, type Column } from "@a31labs/rax/data-table";

const columns: Column<Service>[] = [
  { id: "name", header: "Service", cell: (s) => s.name, subtitle: (s) => s.desc, sortValue: (s) => s.name },
  { id: "req", header: "Requests", cell: (s) => s.req, sortValue: (s) => s.req, numeric: true, firstSort: "desc", hideable: true },
  { id: "p95", header: "p95", cell: (s) => s.p95 == null ? null : `${s.p95} ms`, sortValue: (s) => s.p95, numeric: true, hideable: true, defaultHidden: true },
];

<DataTable label="Services" rows={rows} columns={columns} getRowId={(s) => s.id}
  state={isLoading ? "loading" : error ? "error" : "ready"} error="Could not load services." onRetry={refetch}
  empty={{ title: "No services yet", action: <Button>New service</Button> }}
  selectable selected={selected} onSelectedChange={setSelected}
  globalFilter={query} pageSize={25}
  resizable reorderable storageKey="services" rowHref={(s) => `/services/${s.id}`} onRowNavigate={(href) => router.push(href)} />

// server data: rows render as given, the table reports sort and page intent
<DataTable label="Services" rows={pageRows} columns={columns} getRowId={(s) => s.id}
  manual={{ sort, onSortChange: setSort, page, pageCount, onPageChange: setPage, total }} />