DataTable
The default renderer for useDataTable — draws the standard Murray toolbar, filter bar and table.
- Overview
- Props
DataTable is the default renderer for a table built with useDataTable. It
consumes the hook's instance and draws the standard Murray layout: an optional toolbar/filter row
above a table. It holds no state of its own — all behavior (filters, selection, row navigation)
rides on the instance and lives in the hook.
5 employees
| Name | Entity | Comment | Status |
|---|---|---|---|
| Foo | Bar | Blabla | Covered |
| Qux | Bar | Onboarding | Not covered |
| Zap | Baz | New hire | Covered |
| Wob | Baz | Left | Not covered |
| Nix | Bar | Paperwork | Processing |
Props
| Prop | Type | Default | Description |
|---|---|---|---|
table | DataTableInstance<T> | — | Required. The instance returned by useDataTable. |
toolbar | { placement: "start" | "end"; component: ReactNode }[] | [] | Extra elements above the table, grouped start/end (counts, buttons…). |
title | string | null | null | Accessible table title. Pass a string when the page doesn't already describe the table. |
loading | boolean | false | No rows: skeleton body. Rows on screen: loading overlay over them. See Loading. |
A filter bar renders at the start of the toolbar whenever the instance carries filter defs
(filters.defs on the hook) — there is no separate prop for it. Likewise, a centered pager footer
renders under the table whenever the instance carries pagination
(hidden while there is a single known page).
Toolbar
toolbar elements are grouped by placement and laid out on either side of the row above the table —
start elements sit next to the filter bar, end elements are pushed to the far end. Use it for row
counts, bulk actions, exports, etc.
5 employees
| Name | Entity | Comment | Status |
|---|---|---|---|
| Foo | Bar | Blabla | Covered |
| Qux | Bar | Onboarding | Not covered |
| Zap | Baz | New hire | Covered |
| Wob | Baz | Left | Not covered |
| Nix | Bar | Paperwork | Processing |
Loading
loading picks the right visual from what's on screen — you never declare the phase yourself:
- No rows to show (first load): the body renders skeleton rows —
pagination.pageSizeof them (5 without pagination). - Rows on screen (a refetch keeping the previous rows via
placeholderData: keepPreviousData): the rows stay put under a loading overlay that blocks interactions until the fetch resolves
| Name | Entity | Comment | Status |
|---|---|---|---|
| Loading… | |||
| Name | Entity | Comment | Status |
|---|---|---|---|
| Foo | Bar | Blabla | Covered |
| Qux | Bar | Onboarding | Not covered |
| Zap | Baz | New hire | Covered |
| Wob | Baz | Left | Not covered |
| Nix | Bar | Paperwork | Processing |
Building your own renderer
DataTable is only one way to render the hook's output. If the standard layout doesn't fit, skip it
and read directly from the instance: instance.table is the cherry-picked
@tanstack/react-table surface, and instance.filters,
instance.selection and instance.rowNavigation sit next to it — the state and logic still come
from useDataTable.
Accessibility
title— accessible table title (pass one unless the surrounding page already labels the table).- Row-level labels (
selection.getRowLabel,rowNavigation.getRowNavigationLabel) are configured on the hook — seeuseDataTable. - While
loading, skeletons arearia-hidden; a visually-hidden localized "Loading…" announces the state.
Undocumented props
| Name | Type | Default Value | Description | Usage count |
|---|---|---|---|---|
| loading | any | |||
| table | any | |||
| title | any | |||
| toolbar | any |