Skip to content
Browse documentation
whisk/ui

DataTable

Render application data with the portable data-table contract.

Overview

DataTable renders a small, rectangular snapshot of display-ready text as a native table. It does not fetch data or infer formatting, sorting, filtering, pagination, selection, actions, or row state.

Use when

You have a small, bounded snapshot of read-only display text with column headers.

Use instead

Use Table parts when data needs links, controls, rich formatting, sorting, filtering, pagination, selection, or application-owned row state.

Usage

Open projects
ProjectStatus
AtlasActive
BeaconPlanned
import { DataTable } from "@smoothie-framework/whisk-react";

<DataTable
  caption="Open projects"
  columns={["Project", "Status"]}
  rows={[
    { cells: ["Atlas", "Active"] },
    { cells: ["Beacon", "Planned"], emphasized: true },
  ]}
/>

Examples

Pass display-ready text

DataTable accepts strings, not records, formatters, or cell renderers. Format values before creating the rectangular rows, then preserve the same order as the column labels.

Recent releases
ProjectPublishedBundle size
Atlas14 Oct 202612.4 MB
Beacon10 Oct 20268.1 MB
import { DataTable } from "@smoothie-framework/whisk-react";

const releaseRows = [
  { cells: ["Atlas", "14 Oct 2026", "12.4 MB"] },
  { cells: ["Beacon", "10 Oct 2026", "8.1 MB"], emphasized: true },
];

<DataTable
  caption="Recent releases"
  columns={["Project", "Published", "Bundle size"]}
  rows={releaseRows}
  striped
/>

Keep an empty result truthful

An empty rows array is valid. DataTable keeps the caption and headers but does not invent an empty-state message or action; use Table parts and surrounding application UI when people need recovery or next steps.

Deployment history
EnvironmentVersionPublished
import { DataTable } from "@smoothie-framework/whisk-react";

<DataTable
  caption="Deployment history"
  columns={["Environment", "Version", "Published"]}
  rows={[]}
/>

Contain a wide direct table

DataTable does not choose a scroll container. Wrap a direct wide table in TableScrollArea so essential columns remain available, and name that scroll region when its purpose is not already obvious.

Project audit history
ProjectActorEventSourceTime
AtlasRosaPublishedCLI14 Oct, 14:32
import { DataTable, TableScrollArea } from "@smoothie-framework/whisk-react";

<TableScrollArea frame="outline" aria-label="Project audit history">
  <DataTable
    caption="Project audit history"
    columns={["Project", "Actor", "Event", "Source", "Time"]}
    rows={[
      { cells: ["Atlas", "Rosa", "Published", "CLI", "14 Oct, 14:32"] },
    ]}
    style={{ minWidth: "48rem" }}
  />
</TableScrollArea>

Use Table for rich or interactive cells

DataTable has no cell renderer, children, actions, or sort state. Switch to Table parts when a cell needs a link, button, badge, formatted value, row header, or other application-owned behavior.

tsx
import {
  Button,
  Table,
  TableBody,
  TableCaption,
  TableCell,
  TableColumnHeader,
  TableHeader,
  TableRow,
} from "@smoothie-framework/whisk-react";

<Table>
  <TableCaption side="top">Projects</TableCaption>
  <TableHeader>
    <TableRow>
      <TableColumnHeader>Project</TableColumnHeader>
      <TableColumnHeader>Actions</TableColumnHeader>
    </TableRow>
  </TableHeader>
  <TableBody>
    <TableRow>
      <TableCell>Atlas</TableCell>
      <TableCell><Button size="sm" variant="secondary">Open project</Button></TableCell>
    </TableRow>
  </TableBody>
</Table>

Props

Component props

PropTypeDefaultDescription
captionstringnoneRequired visible table name. It must be nonblank and contain at most 256 code points.
columnsreadonly string[]noneOne to twelve nonblank labels in display order; each label can contain up to 128 code points.
rowsreadonly DataTableRow[]noneZero to fifty source-ordered rows. Every row needs exactly one display-ready text cell for each column.
row.cellsreadonly string[]noneText-only cells, up to 512 code points each. Format dates, numbers, and currency before passing them to DataTable.
row.emphasizedbooleanfalseAdds visual emphasis only; it does not add selection, status, or interaction behavior.
Table props and native table attributesTablePropsTable defaultsPass size, variant, striped, layout, className, style, or native table attributes. children is not supported.

Accessibility

DataTable renders an ordinary native table with a top caption and scoped column headers. Make the caption and labels understandable out of context, and keep their order aligned with every row. It does not add a live region, keyboard navigation, sort state, or an empty-state message. Empty rows render a valid table with no data cells. For a wide direct DataTable, wrap it in a named TableScrollArea; the catalog renderer adds that wrapper automatically. Use Table parts when a relationship needs row headers, rich cells, controls, or interactive data-grid behavior.

Content guidance

Write the caption and column labels so the data makes sense when read out of context. Keep cell values short and use a regular Table when cells need richer content.