Table primitives

The styled markup a table is made of, composed by hand. Reach for these when Data table does not fit, rather than adding a prop to Data table for a layout only one screen needs.

Reach for it

A table the Data table does not fit: a summary, a nested layout, a fixed set of rows.

Not for

Anything that needs sorting or selection. That is the Data table, not a new prop on it.

Composed by hand

Every part is a component, so the markup stays a real table: a caption, a header, rows, cells and an alignment per column. Row intents are the same vocabulary Data table uses, which is what keeps a hand-built table looking like the rest of the product.

MethodShare
Direct debit82%
Transfer14%
Card3%
Unreconciled1%
Instant payment0%

A header that stays in view

Give the table a height and its rows scroll inside it while the header stays put. A pinned column keeps its place sideways too, and the cell where the two meet stays on top in both directions. The scrolling area is a named region, so a keyboard can reach it and scroll a table that holds no control.

ReferenceDebtorMethodDue dateAmount
INV-1042Mooncard SASDirect debit12/03/202612,480.00
INV-1043Acme SASTransfer14/03/2026980.00
INV-1044GlobexDirect debit15/03/20264,200.00
INV-1045InitechCard18/03/2026310.00
INV-1046Umbrella SARLDirect debit21/03/20267,650.00
INV-1047HooliTransfer22/03/20261,125.00
INV-1048Stark IndustriesDirect debit25/03/202623,900.00
INV-1049Wayne SASTransfer27/03/2026640.00
INV-1050WonkaCard28/03/202689.00
INV-1051SoylentDirect debit30/03/20265,300.00
INV-1052TyrellTransfer02/04/20262,750.00
INV-1053CyberdyneDirect debit04/04/202611,020.00

API reference

Table

PropTypeDefaultDescription
label*string-Names the table for assistive technology. Required: an unnamed table is a grid of nothing.
isBusyboolean-Announces that rows are being replaced, so a screen reader knows to wait.
layout'auto' | 'fixed'-`fixed` makes declared column widths authoritative. Under the browser default the widest cell wins, so one long debtor name drags every other column out of alignment and the header no longer sits over its data.
minWidthnumber-Below this width the table scrolls instead of squeezing its columns.
maxHeightnumber-Pixels. Past this height the rows scroll under the header, which stays in view. The table has to scroll itself for that: the wrapper scrolls sideways, so it is what a sticky header anchors to, and the page scrolling past it moves the header with the rest.

Also takes the standard attributes of a table, minus className and style.

TableColGroup

PropTypeDefaultDescription
children*ReactNode-

TableCol

PropTypeDefaultDescription
widthTableColumnWidth-

TableHeader

Also takes the props of HTMLAttributes<HTMLTableSectionElement, minus .

TableBody

Also takes the props of HTMLAttributes<HTMLTableSectionElement, minus .

TableFooter

Also takes the props of HTMLAttributes<HTMLTableSectionElement, minus .

TableRow

PropTypeDefaultDescription
intent'default' | 'muted' | 'success' | 'warning' | 'danger'default
isInteractivebooleanfalse
isSelectedbooleanfalse

Also takes the standard attributes of a table row, minus className and style.

TableHead

PropTypeDefaultDescription
alignTableAlign-
onSort() => void-Makes the header a sort control. Omit for a column that cannot be sorted.
sortDirection'ascending' | 'descending' | 'none'-
isStickyTableSticky-Pins the column against one edge while the table scrolls sideways.
stickyOffsetnumber-Pixels from that edge, so a second pinned column rests against the first.

Also takes the standard attributes of a table cell, minus className and style.

TableCell

PropTypeDefaultDescription
alignTableAlign-
isStickyTableSticky-Pins the column against one edge while the table scrolls sideways.
stickyOffsetnumber-Pixels from that edge, so a second pinned column rests against the first.
isTruncatedboolean-One line, ellipsised. Needs a column width to bite against.
isNumericboolean-Lining figures of equal width, so a column of amounts lines up.

Also takes the standard attributes of a table cell, minus className and style.

TableCaption

PropTypeDefaultDescription
children*ReactNode-