crispmeasured from Attio

DataTable

A config-driven data grid — sort, filter, select, and inline-edit.

The batteries-included, API-driven data grid: pass columns + data and get sorting (click a header), a search filter, row selection (with select-all), and inline editing — all controllable via props. Built on the composable Table primitives, so it inherits the same look. Generic over any row type with a string id.

Use this for real application tables. Reach for RecordsTable only when you specifically want Attio's records grid (typed-cell pickers, sticky columns, bulk bar); use Table when you want to lay out cells by hand.

Preview

Try it — sort by any header, search, select rows, and click a Name or Role cell to edit it.

6 rows
DomainCategories
GGooglegoogle.comSearchAdsCloudAI182,000Customer
SStripestripe.comPaymentsFintech8,000Lead
FFigmafigma.comDesignSaaS1,300Customer
NNotionnotion.soSaaSProductivity800Prospect
VVercelvercel.comCloudDev tools500Customer
LLinearlinear.appDev tools60Lead
192,660

Usage

import { DataTable, type DataTableColumn } from "crisp";

const columns: DataTableColumn<Person>[] = [
  { key: "name", header: "Name", sortable: true, editable: true },
  { key: "status", header: "Status", sortable: true,
    render: (v) => <Badge tone={v === "active" ? "success" : "neutral"} dot>{v}</Badge> },
  { key: "score", header: "Score", sortable: true, align: "right" },
];

<DataTable
  columns={columns}
  data={people}
  filterable
  selectable
  interactive
  defaultSort={{ key: "score", dir: "desc" }}
  onSelectionChange={setSelected}
  onEdit={(id, key, value) => update(id, key, value)}
/>;

API

DataTableProps<T>

PropTypeDescription
columnsDataTableColumn<T>[]Column config (see below).
dataT[]Rows; each needs a string id.
selectablebooleanShow a selection column + select-all.
selectedIds / onSelectionChangestring[] / (ids) => voidControlled selection.
sort / defaultSort / onSortChangeSortState | nullControlled or seeded sort.
filterablebooleanShow the search box.
onEdit(id, key, value) => voidCommit handler for inline edits.
interactive / onRowClickboolean / (row) => voidRow hover + click.
emptyReactNodeBody content when there are no rows.

DataTableColumn<T>

key, header, and optional sortable, filterable, editable, align, width, render(value, row), and accessor(row) (derive the sort/filter/display value).

On this page