DataTable
Murray's toolkit for structured, tabular data on web. State and rendering are two separate pieces you compose:
useDataTableowns the state (data, columns, filters, selection, row identity). It wraps@tanstack/react-tableas its baking library and exposes a small Murray-owned API.DataTableis the default renderer. It takes what the hook returns and draws the standard Murray layout (toolbar, filter bar, table).
The default layout doesn't fit? You can build your own renderer on top of useDataTable and drop
DataTable entirely.
Quick start
useDataTable takes data + columns and returns a table instance; DataTable renders it.
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 |
import { DataTable, useDataTable } from "murray/advanced/data-table";
const { table } = useDataTable<Employee>({ data, columns });
return <DataTable table={table} title="Employees" />;
Read next
useDataTable— the hook: options, returns, filters, selection, row navigation.DataTable— the renderer: props, toolbar, layout.