sigilUI

Data Table

A token-driven data table with custom cell renderers, click handling, and empty states.

@sigil-ui/componentsReact

Preview

Live preview Interactive

Import

import { DataTable } from "@sigil-ui/components";

Usage

<DataTable
  columns={[
    { key: "name", header: "Name" },
    { key: "status", header: "Status" },
  ]}
  data={[{ name: "Project Alpha", status: "Active" }]}
/>

Each column accepts either key (Sigil convention) or accessorKey (TanStack convention) — they're treated as aliases.

Props

PropTypeDefaultDescription
columnsDataTableColumn<T>[]—Column definitions.
dataT[]—Row data.
emptyMessagestring"No results."Shown when data is empty.
onRowClick(row: T, index: number) => void—Click handler that adds cursor-pointer to rows.
rowClassNamestring | (row, index) => string—Per-row className override.
getRowId(row: T, index: number) => string—Stable React key for each row.

DataTableColumn<T>

FieldTypeDescription
keystringColumn id and default property accessor.
accessorKeystringAlias for key.
headerReactNodeHeader label.
cell(row, index) => ReactNodeOptional custom cell renderer.

Token integration

CSS VariablePurpose
--s-text / --s-text-mutedCell text colors
--s-border / --s-border-mutedRow separators (inherited from Table)
--s-surfaceHover row background (inherited from TableRow)
--s-radius-mdFrame radius