Skip to main content
Brand and assets
Build
Monitor and contribute
/
Patterns & layouts
  • Overview
  • Layouts
  • PageLayout
  • FullPageLayout
  • Patterns
  • Forms & density
  • Composition (asChild)
  • Rich components
  • DataTable
    • useDataTable
    • DataTable
    • Examples
  • DataTable

DataTable

Murray's toolkit for structured, tabular data on web. State and rendering are two separate pieces you compose:

  • useDataTable owns the state (data, columns, filters, selection, row identity). It wraps @tanstack/react-table as its baking library and exposes a small Murray-owned API.
  • DataTable is 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

Employees
NameEntityCommentStatus
FooBarBlabla

Covered

QuxBarOnboarding

Not covered

ZapBazNew hire

Covered

WobBazLeft

Not covered

NixBarPaperwork

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.
Edit this page
Previous
Composition (asChild)
Next
useDataTable
  • Quick start
  • Read next