Table

On this page

InstallationUsageWhen to use itAnatomyThe headerThe wordDown to its iconSortingThe (i)AlignmentThe Table's own headersHow a table narrowsThe orderThe two sets of floorsTry itColumnsData and sortingWhat a row doesRows that openRow actionsSelection and bulk actionsThe toolbarFiltersFitting the widthHeight and scrollingStatesIn a cellAPI ReferenceDataTableTableColumnThe header cellThe cellWhat a cell holdsPredefined columnsThe other typesAccessibilityRulesOpen questionsColor and textRows and actionsCellsLayoutWhat others expose

Table

A list of records: rows on a card, from a list of columns. It sorts, pages, selects, opens rows and fits its width by itself; a screen passes columns, one page of data and what to ask for next. It is in the catalog; no dashboard screen uses it yet.

Agents
Actions
billing-assistantActive293,764October 22nd, 2026
docs-searchSuspended26,800,994August 30th, 2026
expense-auditorActive6,818,614October 19th, 2025
hr-assistantRevoked6,883,940February 17th, 2026
invoice-readerProvisioned0December 24th, 2025
12 total results
RowsPage 1 of 3
1<DataTable2  columns={columns}3  data={agents}4  getRowKey={(row) => row.id}5  title="Agents"6  search={<Input size="sm" iconStart={MagnifyingGlass} … />}7  filters={<FilterButton fields={fields} filters={filters} onFiltersChange={setFilters} />}8  columnsMenu9  actions={<Button>Register agent</Button>}10  rowHref={(row) => `/agents/${row.id}`}11  rowActions={(row) => [12    { label: "Edit", icon: PencilSquare, onClick: () => edit(row) },13    { label: "Delete", icon: Trash, variant: "destructive", onClick: () => remove(row) },14  ]}15  sort={sort}16  onSortChange={setSort}17  pagination={{ page, pageSize, total, onPageChange: setPage, onPageSizeChange: setPageSize }}18/>

Installation

text
import { DataTable, type TableColumn } from "@dome-systems/ds-dashboard/components";

Usage

A screen writes its columns once, keeps the sort and the page, asks its server, and passes the answer. It never imports the engine (TanStack Table): the props here are the whole surface.

text
import { Badge, DataTable, Truncate, type TableColumn, type TableSort } from "@dome-systems/ds-dashboard/components";
import { Dot } from "@dome-systems/ds-dashboard/icons";
import { formatTableDate, formatTableNumber } from "@dome-systems/ds-dashboard/lib/table-format";
text
const columns: TableColumn<Agent>[] = [
  { id: "name", header: "Name", grow: true, hideable: false, sortable: true, cell: (row) => <Truncate>{row.name}</Truncate> },
  { id: "status", header: "Status", width: 124, cell: (row) => <Badge size="md" color="success" iconStart={Dot}>{row.status}</Badge> },
  { id: "tokens", header: "Tokens", width: [104, 76], sortable: true, align: "end", cell: (row, form) => formatTableNumber(row.tokens, form) },
  { id: "createdAt", header: "Created", width: [176, 108, 88], cell: (row, form) => formatTableDate(row.createdAt, form) },
];

export function AgentsList() {
  const [sort, setSort] = useState<TableSort>({ column: "name", direction: "asc" });
  const [page, setPage] = useState(1);
  const [pageSize, setPageSize] = useState(25);
  // The list's own query: one page, sorted by the server.
  const { rows, total, isPending } = useAgentsPage({ sort, page, pageSize });

  return (
    <DataTable
      columns={columns}
      data={rows}
      getRowKey={(row) => row.id}
      loading={isPending}
      rowHref={(row) => `/agents/${row.id}`}
      rowLink={ScopedLink}
      sort={sort}
      onSortChange={setSort}
      pagination={{ page, pageSize, total, onPageChange: setPage, onPageSizeChange: setPageSize }}
      emptyState={{ icon: IconFor.Agents, heading: "No agents yet", action: { label: "Register agent", onClick: openRegister } }}
    />
  );
}

When to use it

For every list (the table rules, T10: one Table for every list, in a card). Dashboard lists use this component directly; screens pass their columns, server page, and actions without a local table wrapper.

Anatomy

Actions
billing-assistantActive293,764October 22nd, 2026
docs-searchSuspended26,800,994August 30th, 2026
expense-auditorActive6,818,614October 19th, 2025
hr-assistantRevoked6,883,940February 17th, 2026
invoice-readerProvisioned0December 24th, 2025
12 total results
RowsPage 1 of 3
  1. 1 — Tabs. At the toolbar's right, before the Filter button: a split of the list, as the simple tabs.
  2. 2 — Search. Always at the left: first, or right after a title.
  3. 3 — Filter. The Filter button, in the toolbar's `filters` slot.
  4. 4 — Columns. Which columns show, the Responsive switch, and Reset. It sits between filters and page actions.
  5. 5 — Header row. Pinned and opaque, 12px labels. A sortable header sorts from anywhere on its cell.
  6. 6 — Row. The name is what you press. When columns give way, a folded status dot and “+N” follow it.
  7. 7 — Row actions. One icon button, or the three dots, always in view, in a column the table adds.
  8. 8 — Count. The total, then a note about the list. In the card's footer.
  9. 9 — Pager. Rows per page, while some page size gives the list a second page; the page with Previous and Next only past one page.
PartSizeText
Toolbar28px controls, on the card's insetlabel-1 title, 15px
Header row40px, the muted tint over the card's filllabel-3, 12px
Row36px at least, and a 1px rule under itbody-2, 13px
Cell8px each side, at most half its own tracksecondary; a name or link that goes somewhere, full
Row action24px ghost button, in a 48px column
FooterThe card's footer; 24px controlsbody-3, 12px

Underneath it is a real table with its sections, rows and cells, laid out as a grid with subgrid rows, so a hidden column is a 0px track and widths can ease.

The header

The header row names each column and sorts the list. The Table draws it from each column's own facts (header, label, icon, help, sortable, align): a screen draws nothing in it.

1const columns = [2  { id: "name", header: "Name", grow: true, sortable: true, … },3  statusColumn({ icon: Pulse, into: "name", status: … }),4  numberColumn({ id: "tokens", header: "Tokens", icon: Binary, help: "Tokens in and out, over the last 30 days", value: … }),5  dateColumn({ id: "created", header: "Created", icon: Calendar, date: … }),6];7
8<DataTable columns={columns} data={agents} sort={sort} onSortChange={setSort} />
PartValueWhere
Height40pxthe header row
Fill--table-head-tintover --table-head-background
Textlabel-3, 12px--table-head-foreground-text
Pinnedstays at the top while the rows scroll under itthe scroll area's top fade starts under it; its side fades leave it uncovered

The word

header is the column's word, one or two words, cut with an ellipsis (Truncate) as the column narrows. label names the column where the header can't show its word: its row in the columns menu, its icon's tooltip, its line behind a row's “+N”. Unset, it is the header's word. A cell never repeats the header (T1): under “Events” a cell reads 5, not “5 events”.

Down to its icon

With Responsive on, a header's word is cut down to 3 letters, then the column shows its icon alone: 14px, in a 30px form (the icon and 8px each side). The icon's tooltip is its label. With Responsive off, a header keeps its word down to 5 letters and never becomes its icon by itself; a column the person narrows by hand keeps its word down to 3 letters, then shows its icon, and so does a header whose handle, under the pointer, would leave fewer than 3 letters. The growing column (the name) never becomes its icon. As room comes back, the headers' words come back before any column gets more room. The order every column follows is in “How a table narrows”.

Sorting

Which headers sort: in an inMemory table every column unless it says sortable: false; in a list the server sorts, the columns that say sortable. A table that opens sorted shows it on that header (sort, or defaultSort).

A sortable header's word is a button that covers the whole cell: a click sorts ascending, the next one descending. What is inside it (the (i), an icon's tooltip) still answers the pointer. Two triangles mark it, each 6 × 3.5px with 0.75px corners, 2px apart, in the middle of their 12px frame, 4px from the word, 5px from an icon, 3px from the (i) (TABLE_HEAD_GAPS). The sorted column always shows its pair, the active triangle in --table-sort-active. Any other sortable column shows them only while the pointer is anywhere on the column, or the keyboard is on its header. A header at its narrowest (its icon alone) still sorts; its triangles step aside. The header cell says aria-sort: ascending, descending, or none.

The (i)

help is what the column means, in a sentence: an (i) beside the header's word, one gap (5px) from it, and its tooltip. The parts go word, (i), sort marks, away from the side the header is aligned to. The word cuts first, and the (i) stays; the Table keeps 19px for it (its 14px and the gap) when it measures the header. In the column's icon form, the icon's tooltip says both: “Tokens: Tokens in and out, over the last 30 days”.

Alignment

A header lines up with its column's values. A number's header is at the end (numberColumn sets align: "end") and reads marks, (i), word: the word against the edge, above its values. The last column showing is at the end too, unless it sets align. A date's header is at the start unless its column is last. The name's header is never at the end.

The Table's own headers

Three columns are the Table's own, and so are their headers:

ColumnIts header
SelectionWith selectable: a checkbox, “Select all on this page”. It takes or clears the page shown, and shows a dash while some rows are checked.
DragWith reorder: the drag column's (i), from reorder.help, opening down and to the right. With no help, “Order” for a screen reader only.
ActionsWith rowActions: “Actions”, for a screen reader only.

How a table narrows

A table fits its columns to its width. As it narrows, every column steps down in one order, and how far it goes depends on the table's layout: Responsive on cuts hard, so more columns stay in view; Responsive off keeps every value readable and scrolls sideways instead, because the person chose to scroll rather than to hover. The floors are TABLE_FLOORS in @dome-systems/ds-dashboard/lib/table-floors; a screen never sets them.

The order

  1. The forms the column says (width, widest first): a shorter date, a compact number. No form is narrower than the header's whole word.
  2. Every value at its floor (below), and the row's name at its least, 160px.
  3. The headers' words cut to their floor, the shortest word first.
  4. The headers turn to their icons, the shortest word first (Responsive on only).
  5. A status joins the name cell as its dot, then the columns leave for the “+N” at the end of the name, least important first (priority, or a column's own ladder).

Why: a header is its icon only when the words do not fit. Room goes back to the headers' words before any column gets more than it needs, the longest word first. Each step is decided from the columns' fixed forms, so dragging a width never turns a header back and forth.

The two sets of floors

A column is one of four kinds, and its kind says how it gives way and where it sits: a number, a date (or a time ago), a status, and text, which is everything else, a badge's word included.

AlignsResponsive onResponsive off
HeaderAs its columnIts word, cut down to 3 letters, then its iconIts word, cut to no fewer than 5 letters; never its icon
Text: a name, an owner, a codeLeft; right as the last column. An email may sit right; a name never does5 characters and “…”, then the column leaves10 characters and “…”
BadgeLeft; right as the last column5 characters of its word, then the column leaves10 characters of its word
StatusLeft; right as the last columnIts dotIts word
NumberRight, wherever it isNever cut: it shortens (123,456 → 123.5K) down to its shortest whole form (1.3K, 195K)The same
Date, time agoLeft; right as the last columnNever cut: it shortens step by step (November 12th, 2026 → Nov 12, 26 → 11/12/26; 3 hours ago → 3h), never “…”The same

A number or a date is never cut: a cut number reads as a different number. Its column is never narrower than the shortest whole form of its values (numberColumn, dateColumn and agoColumn give it, as least); past that, the column leaves.

Responsive off keeps the words: the person chose to scroll, so nothing should need a hover to be read. A header's cut word is the column's least, even over values that need less.

Responsive off, the edge cuts into a column: a table that scrolls sideways ends inside its last column, two thirds of that column's widest value in view, measured from where its values start; the header is left out. Taken on the column's whole width, a thin column of short numbers would only look faded; taken on its values, it is visibly cut, so it is plain there is more.

Responsive off, the cover: every edge the rows run on past has the cover (SCROLL_AREA_PRESETS.cover): a 20px fade, linear, hiding 80% at the very edge, on the sides and the bottom, and the top once the rows have scrolled under the header. What runs on still reads as there. A responsive table has no sideways fade: nothing in it runs on sideways. Its rows still have the cover above and below.

Responsive off, a person moves and resizes the columns: with the pointer in a column its two edges show, and on its header, on every column but the first, the handle too. The handle moves the column; an edge resizes it, down to its header's smallest form, its (i), marks and handle each in its 12px frame (55px for an icon column that does not sort, 69 when it also sorts), and no further, and the next column takes the room it gives (after the last, the column that grows). Wider, it takes no room from any other column: every column at its right keeps its width and is pushed, and the table scrolls sideways. The last column, whichever a person moved there, has a right edge of its own only when the row's actions follow it, and pulled wider it pushes them; with no row actions its right side is the table's. The row's actions never move. Nothing is kept: a reload, or Responsive on, brings back the table's own order and widths.

The first time, the edges say so: until a person has taken an edge or moved a column once, a column under the pointer shows its two edges in the link color at 1px, so moving and resizing can be found. From the first touch they are the muted gray, for good: the dashboard keeps it in the person's preferences, in every browser. Nothing shows with Responsive on. The playground's “first time” switch shows it again.

A header reaches 3 letters only over small values: a column is as wide as its widest need, and text keeps 5 characters, so a header is cut that far over numbers, dots and short badges.

Try it

The same columns in both layouts. Drag a table's side to narrow it; double-click the side for the page's width.

1// Responsive on: the person's choice, or a page that fixes it2<DataTable columns={columns} data={agents} overflow="responsive" />3// Responsive off: the same columns, readable values, a sideways scroll4<DataTable columns={columns} data={agents} overflow="scroll" />

Columns

A table is a list of columns. A column says what it shows (cell), how wide it is, and what it does when the table gets narrow. The Table sets the text colors: no column sets a color.

id, header, cell

The least a column needs. cell returns what the cell shows; values are drawn in the secondary text color, the name in the full one once it goes somewhere.

1const columns: TableColumn<Agent>[] = [2  { id: "name", header: "Name", grow: true, cell: (row) => <Truncate>{row.name}</Truncate> },3  { id: "status", header: "Status", width: 124, cell: (row) => <Badge color="success" dot>Active</Badge> },4  { id: "tokens", header: "Tokens", width: 104, align: "end", cell: (row) => formatTableNumber(row.tokens, 0) },5];6
7<DataTable columns={columns} data={agents} getRowKey={(row) => row.id} />

width, and a cell's forms

width is a number of px, or the width at each form, widest first: [176, 108, 88]. cell(row, form) gets the index of the form the column is at, so a date goes from long to short and a number from whole to compact. A compact number that dropped something is a TableShort: the whole number is under the pointer.

1{2  id: "createdAt",3  header: "Created",4  width: [176, 108, 88],5  cell: (row, form) => formatTableDate(row.createdAt, form, "UTC"),6},7{8  id: "tokens",9  header: "Tokens",10  width: [104, 76],11  align: "end",12  cell: (row, form) => <TableShort full={formatTableNumber(row.tokens, 0)}>{formatTableNumber(row.tokens, form)}</TableShort>,13}

grow and align

grow gives one column the room the others leave: the name, usually the first. align: "end" sets a column against its right edge, as every number is (numberColumn sets it); its header follows. A date sets none: the Table puts the last column right.

1{ id: "name", header: "Name", grow: true, cell: … },2{ id: "tokens", header: "Tokens", align: "end", cell: … },3{ id: "createdAt", header: "Created", cell: … }

sortable and sortValue

A sortable column's whole header cell sorts. The sorted column always shows its two triangles; another shows them only under the pointer. sortValue is what an inMemory table sorts by; a server-sorted one never calls it.

1{ id: "tokens", header: "Tokens", sortable: true, sortValue: (row) => row.tokens, cell: … }

help and icon

help is the header's tooltip: what the column means, in a sentence (point at Tokens). icon stands in for the header once the column is too narrow for four letters of its label, with the label in a tooltip: Last active is 48px wide here.

1{ id: "tokens", header: "Tokens", help: "Tokens in and out, over the last 30 days", cell: … },2{ id: "lastActive", header: "Last active", icon: History, width: 48, cell: … }

link

A column whose value goes somewhere draws it with TableLink and says where in link. While the column is not showing, a table with row actions adds “Go to gateway” to that row's actions, and the value still counts in “+N”. Pick 400px and open a row's menu.

1{2  id: "gateway",3  header: "Gateway",4  link: (row) => (row.gateway ? { href: gatewayPath(row.gateway) } : undefined),5  text: (row) => row.gateway,6  cell: (row) => <TableLink href={gatewayPath(row.gateway)}>{row.gateway}</TableLink>,7}

merge and text

What a column does when there is no room for it. text is its line behind the “+N” badge that ends the name cell. merge keeps a value in sight instead: it joins another column's cell as a guest. Only a status does that, as TableStatusDot, first after the name. Pick 420px, then 340px.

1{2  id: "status",3  header: "Status",4  width: 124,5  cell: (row) => <Badge color="success" dot>Active</Badge>,6  text: (row) => "Active",7  merge: { into: "name", width: 20, order: 0, cell: (row) => <TableStatusDot color="success" label="Status: Active" /> },8}

hideable and defaultHidden

With columnsMenu, a person turns columns on and off. hideable: false keeps a column out of the menu (the name). defaultHidden starts one off until it is asked for. Open the columns control at the bar's right.

1{ id: "name", header: "Name", hideable: false, … },2{ id: "createdAt", header: "Created", defaultHidden: true, … }3
4<DataTable columns={columns} columnsMenu … />

Data and sorting

A server list is the normal case: data is the page the server answered with, already sorted and filtered, and the table says what to ask for next. It never sorts or pages rows it was not given.

A server's page: sort, onSortChange, pagination

The page keeps the sort and the page number, asks the server, and passes the answer. This example plays the server in the browser, and goes back to page 1 on a new sort itself: the table does not do that for a server list.

1const [sort, setSort] = useState<TableSort>({ column: "name", direction: "asc" });2const [page, setPage] = useState(1);3const { rows, total } = useAgents({ sort, page, pageSize: 25 });4
5<DataTable6  columns={columns}7  data={rows}8  getRowKey={(row) => row.id}9  sort={sort}10  onSortChange={(next) => { setSort(next); setPage(1); }}11  pagination={{ page, pageSize: 25, total, onPageChange: setPage }}12/>

A cursor's page: pagination with hasNext, no total

A list the server pages by cursor knows no total. It gives hasNext and no total, and the footer has no count and no “Page x of y”: Previous and Next at the right, Previous on from page 2, Next while hasNext, and with onPageSizeChange the rows-per-page select while it pages. The page keeps its own cursors and moves on onPageChange; it never draws a pager or a count of its own in note.

1const [tokens, setTokens] = useState<string[]>([""]);2const { rows, nextPageToken } = useConnections(tokens.at(-1));3
4<DataTable5  columns={columns}6  data={rows}7  getRowKey={(row) => row.id}8  pagination={{9    page: tokens.length,10    hasNext: Boolean(nextPageToken),11    onPageChange: (page) => setTokens((now) => (page > now.length ? [...now, nextPageToken] : now.slice(0, page))),12  }}13/>

inMemory

For a short list that arrives whole: the table sorts it by each column's sortValue and pages it in the browser, and pagination needs no page or total. A list that can grow must not use it.

1<DataTable columns={columns} data={agents} getRowKey={(row) => row.id} inMemory pagination={{ pageSize: 5, pageSizes: [5, 10] }} />

What a row does

What is pressed in a row is its name, in the first column, never the row. Every row tints under the pointer; only a name that goes somewhere takes the hand and the link color.

rowHref and rowLink

The name becomes a real link to the row's page: it opens in a new tab, Tab reaches it and Enter follows it. rowLink is the link's element, for the router's (ScopedLink in the dashboard).

1<DataTable … rowHref={(row) => `/agents/${row.id}`} rowLink={ScopedLink} />

onRowOpen, isRowActive and canRowOpen

For a row that opens a side panel instead of a page: the name is a button, and isRowActive keeps the row marked while its panel is open. canRowOpen says which rows have one.

1<DataTable2  …3  onRowOpen={(row) => setPanel(row.id)}4  isRowActive={(row) => row.id === panel}5  canRowOpen={(row) => row.status !== "revoked"}6/>

Rows that open

A row can open in place three ways, each with the small chevron before its name. What opens here brightens under the pointer; it never takes the link color.

getSubRows

A parent row's child rows, one step in, in the same columns. A row with none keeps the chevron's room, so names line up.

1<DataTable … getSubRows={(row) => row.children} defaultExpanded={{ [first.id]: true }} />

rowDetail

A panel under the row, with no fill: a line hangs under the row's chevron and the content starts where the name does. It can hold a second, smaller table built from the Table's own parts.

1<DataTable … rowDetail={(row) => <AgentGrants agent={row} />} />

group

Rows that follow one another with the same group id sit under a band with their count. The list arrives sorted by the group. The band is pressed across its whole width.

1<DataTable … group={{ id: (row) => row.kind, label: (id) => (id === "managed" ? "Managed" : "External") }} />

Row actions

A screen passes a list of actions per row, as data, and the table decides how they show, in an Actions column it adds at the end, always in view.

One action

A ghost icon button with the action's name in a tooltip.

1<DataTable … rowActions={(row) => [{ label: "Edit", icon: PencilSquare, onClick: () => edit(row) }]} />

Two or more

The three dots alone. The menu holds them all: safe actions, then “Go to” links, then destructive ones under a line.

1const edit = { label: "Edit", icon: PencilSquare, onClick: … };2const suspend = { label: "Suspend", icon: PauseCircle, onClick: … };3const remove = { label: "Delete", icon: Trash, variant: "destructive", onClick: … };4
5// A revoked agent can only be edited: one action, so its icon.6<DataTable … rowActions={(row) => (row.status === "revoked" ? [edit] : [edit, suspend, remove])} />

labelled

For a single action that must say what it does: a ghost button with its word, in the error text color when it destroys. It is the table's, never a mix: once one row's action is labelled, every row's one action shows its word.

1<DataTable … rowActions={(row) => [{ label: "Revoke", icon: Trash, variant: "destructive", labelled: true, onClick: … }]} />

Selection and bulk actions

Selection is by checkbox and per page. What is selected is one of two shapes, never a list of every id: some rows of the page shown, or everything matching the list's filters.

selectable and bulkActions

A checkbox on every row and in the header; Shift-click takes the rows in between. While something is selected, the bar gives way to the selection's line: “2 of 12 selected” at the left; at the right the bulk actions as one “Actions” menu, the destructive ones last, then Clear. The footer keeps the total.

1<DataTable2  …3  selectable4  bulkActions={[5    { label: "Suspend", icon: PauseCircle, onClick: (selection) => suspend(selection) },6    { label: "Delete", icon: Trash, variant: "destructive", onClick: (selection) => remove(selection) },7  ]}8/>

selection, onSelectionChange and “Select all N”

Check the header box: the footer offers “Select all 12”. Taking it makes the selection { mode: "all" }, a statement, not ids. A bulk action then sends the list's filters to the server, never a million keys. The table clears the selection on a new page, page size, sort or total, and on a new selectionScope.

1const [selection, setSelection] = useState<TableSelection>({ mode: "rows", keys: [] });2
3<DataTable … selectable selection={selection} onSelectionChange={setSelection} />

selectionScope

The table cannot see a page's search or filters, and “all” means everything matching them. Give it the two as one string: a new value clears the selection, so “all” never carries to another set of results that happens to have the same count. Check some rows here, then type in the search.

1const [query, setQuery] = useState("");2
3<DataTable … search={<Input value={query} onChange={…} />} selectable selectionScope={query} />

bulkActionsDisplay

menu, the default, is one “Actions” button. exposed shows the first two as separate 28px buttons with their word, and past two a “More” button holds the rest.

1<DataTable … selectable bulkActions={actions} bulkActionsDisplay="exposed" />

reorder

Rows a person drags into a new order. The drag column comes first, before the selection's, a grip on every row centred under its header, and the (i) there says what the order does (help). A row lifts after 3px, the others slide to open its slot, and letting go hands the page the keys in their new order (onOrderChange); Escape puts it back, and arrow keys on a grip move its row by one. The table sorts by nothing and shows all its rows. disabled keeps the grips, disabled: under the pointer they show the not-allowed cursor and the reason in a tooltip, the one tooltip a grip has.

1const [order, setOrder] = useState(pools.map((pool) => pool.id));2
3<DataTable4  columns={columns}5  data={inOrder(pools, order)}6  getRowKey={(pool) => pool.id}7  selectable8  reorder={{9    onOrderChange: setOrder,10    help: "Requests try these in order, top to bottom.",11    disabled: filtered ? "Clear search and filters to reorder pools" : undefined,12  }}13/>

The toolbar

The line over the rows is one row that never wraps, with 28px controls. At the left: the title, then the search. At the right: the tabs, the page's own buttons, then the table's own controls: the Filter button, and the columns control last, in the corner.

header

inside, the default: the bar is the card's top. outside: it sits over the card, 20px above it, on the table's inset, and the card holds rows only.

1<DataTable … header="outside" title="Agents" search={<Input … />} />

titleHelp

What the list is, in a sentence: an (i) right after the title's words, the same IconTooltip as a column's help, before the title's badges and the search. The keyboard reaches it.

1<DataTable … title="Model rates" titleHelp="Organization-wide provider rates used to estimate what your providers charge you." />

title, tabs and search

tabs is a split of the list such as All / Managed / External: it filters like any filter, but has no chip, and clearing the filters leaves it alone. The tabs sit at the right, before the Filter button. The search is always at the left, after the title if there is one.

1<DataTable2  …3  tabs={{ value: kind, onValueChange: setKind, label: "Agent type", items: [4    { value: "all", label: "All" },5    { value: "managed", label: "Managed" },6    { value: "external", label: "External" },7  ] }}8  search={<Input size="sm" iconStart={MagnifyingGlass} … />}9  columnsMenu10/>

A filter and the page's buttons

actions are the page's own buttons for this list. They sit at the right of the bar, before the table's own controls: the Filter, then the columns control in the corner.

1<DataTable2  …3  title="Recent tool calls"4  search={<Input size="sm" iconStart={MagnifyingGlass} … />}5  filters={<FilterButton … />}6  actions={<><Button size="sm" iconStart={RadioTower}>Stream live events</Button><Button size="sm">View audit history</Button></>}7/>

Short of room

Nothing wraps. In order: the search narrows to 144px, then a title is cut; the Filter button drops its word; the search folds to an icon that opens the field over the bar; the tabs become one select. Here the Filter button has its word at 560px, the search is an icon at 440px, and the tabs are a select at 340px.

1<DataTable … title="Agents" tabs={tabs} search={search} filters={<FilterButton label … />} columnsMenu />

Filters

The Table gives the filters three places and holds none of their state: filters on the bar (the Filter button), filterChips in a row under it, and note in the footer, after the count. The Filter button is a secondary Button like the others on the bar: a screen can give it a word or another icon (label, icon). One chip is the Filter chip, which has its own page.

filters, filterChips and note

One Filter button whose menu lists the fields; what is applied shows as chips, each with its condition and an x; between filters it is AND. The note says how many rows the filters hide. With nothing left, the table draws its empty state with a way out.

1const [filters, setFilters] = useState<Filter[]>([]);2const rows = applyFilters(agents, FIELDS, filters);       // or: send `filters` to the server3const props = { fields: FIELDS, filters, onFiltersChange: setFilters };4
5<DataTable6  …7  data={rows}8  filters={<FilterButton {...props} />}9  filterChips={<FilterChips {...props} />}10  note={<FilterHiddenNote hidden={agents.length - rows.length} onClear={() => setFilters([])} />}11/>

Every kind of field

The full set, so each editor can be tried: a list with several values, a list with one choice, an on/off filter, a text, a date and a number. Every field is edited in the menu, beside its row; an on/off filter is a switch on its own row, and flipping it closes the menu. It is not a real screen's set.

1const FIELDS: FilterField<Agent>[] = [2  { id: "status", label: "Status", type: "list", options: […], get: (agent) => agent.status },3  { id: "policy", label: "Show violations", type: "toggle", options: [{ value: "violation", label: "Violations only" }], get: … },4  { id: "labels", label: "Labels", type: "multi", options: […], get: (agent) => agent.labels },5  { id: "name", label: "Name", type: "text", get: (agent) => agent.name },6  { id: "created", label: "Created", type: "date", get: (agent) => agent.createdAt },7  { id: "calls", label: "Calls", type: "number", get: (agent) => agent.toolCalls },8];

A real screen's set: the Event log

The Event log's filters, recreated here over made-up events; the real screen is not changed. Under the table: what the Filters does for each today, and what it still lacks before that screen can move.

1<DataTable … filters={<FilterButton label {...props} />} filterChips={<FilterChips {...props} />} />

Fitting the width

Every table's columns get narrower before anything else happens: a value shortens (1.2M, a shorter date) and a header is cut, then becomes its icon. That is not a mode. overflow says what happens once no column can get narrower. A table is responsive by default: its least important columns go behind “+N”, and it never scrolls sideways. scroll is the other mode: nothing leaves, and the table scrolls sideways.

The ladder

The columns go down one ladder of steps until they fit (the table rules, T12). These four are whole at 560px. At 460px Type is behind the “+N” that ends the name cell and Status has joined the name as its dot; at 320px Tokens is behind “+N” too. A leaving column's values travel into their row's “+N”, and come back out of it.

1// Unset, `overflow` starts responsive and the table keeps it itself.2<DataTable columns={columns} rowActions={…} … />

priority and ladder

By default a column is as important as it is early: the last column takes each kind of step first. priority reorders that (1 is the most important). ladder numbers one column's steps outright, lowest first: these columns do, so that Type is the first to go behind “+N”. tableLadder(columns) reads the ladder back; this is the ladder of the four columns above (the Actions column's 48px come on top).

1{ id: "tokens", header: "Tokens", width: [104, 76], ladder: [2, 11], … } // one shorter form, then "+N"2{ id: "kind", header: "Type", ladder: [6], … }                           // the first to go behind "+N"3{ id: "status", header: "Status", ladder: [9, 14], merge: { … }, … }     // joins the name, then "+N"4
5tableLadder(columns); // { full, steps: [{ id, step, kind, width }, …] }

overflow

overflow="scroll" takes the columns' narrower forms too, in the ladder's order, and stops there: nothing joins the name or goes behind “+N”, and what does not fit at the narrowest forms scrolls sideways. Where the forms alone fit, it is the same table as the responsive one. The first below has the room; the second, at 460px, is at its narrowest forms and scrolls. The hovered row's action button floats at the right edge until the Actions column scrolls into view. Unset, the table keeps the mode itself, starting responsive, and its columns menu has a Responsive switch.

1<DataTable … overflow="scroll" />

motion

How a step moves: duration is how long a column takes to go into the “+N”, in ms (760), and spring how far the “+N” grows as it takes it in (0.32). Under reduced motion everything cuts.

1<DataTable … motion={{ duration: 1200, spring: 0.5 }} />

Height and scrolling

The rows' area hugs its rows, or has a height. Either way the header row stays pinned and opaque, and the scrollbar starts under it. With Responsive off the cover is over every edge the rows run on past: the sides, and the bottom (the top once scrolled). The scrollbar shows only while the pointer is over the rows or they scroll.

maxHeight

Hugging its rows, the tallest the area grows, in px. Past it the rows scroll under the header row.

1<DataTable … maxHeight={220} />

height

A number of px, or "fill" for all its parent leaves (the parent then needs a height). Short of rows, empty ruled rows run to the bottom, so the table never ends in a blank. They are whole rows at a row's height; what is left over is plain space under the last line, and a line is never drawn half a row or less from the footer's.

1<DataTable … height={300} />2<DataTable … height="fill" />

States

loading

While the first page is on its way: placeholder rows in the columns' own widths, and the body is marked busy.

1<DataTable … data={[]} loading />

emptyState and emptyCard

With no rows, the table draws the ds EmptyState in place of the rows and has no footer. The state has no box of its own: emptyCard is the table's card while it holds it, outline by default (the border without the fill).

1<DataTable2  …3  data={[]}4  emptyState={{5    icon: Robot,6    heading: "No agents yet",7    description: "Register an agent to see it here.",8    action: { label: "Register agent", onClick: … },9  }}10/>

emptyMessage

One line in a row under the headers, in place of an empty state.

1<DataTable … data={[]} emptyMessage="No agents yet" />

In a cell

The pieces a column's cell is written with. Each sits above the row's own click target, so its click is its own.

TableLink, TableShort, TableStatus, TableStatusDot, TableCopyButton, Truncate

TableLink: another link in the row, only for a value that goes somewhere. TableShort: a shortened value with the whole one under the pointer (the dotted line shows with the row). TableStatus: a dot and a name, as text. TableStatusDot: the status folded to its dot, with a tooltip. TableCopyButton: a copy button, its icon alone, that shows with its row. Truncate: text cut with an ellipsis, the whole of it in a tooltip.

1<TableLink href="/gateways/production">production-gateway</TableLink>2<TableShort full="293,812">293.8K</TableShort>3<TableStatus color="success">Active</TableStatus>4<TableStatusDot color="warning" label="Status: Suspended" />5<TableCopyButton value={row.id} label="Copy agent ID" />6<Truncate>{row.description}</Truncate>

A count that means trouble

numberColumn's color: "error" writes the number in the error text color (--error-fg-secondary), for a count like denies. A zero is no trouble and keeps the cell's own color; a row with no number is still the dash.

1numberColumn({ id: "denies", header: "Denies", color: "error", value: (row) => row.denies })

A status with a reason

statusColumn's status can carry a tooltip, the reason behind it (why a request was denied). Its badge then ends in the info icon, and the reason shows on hovering the whole badge, or on its focus. A status with no reason shows neither. Folded into the name, the dot says the reason after its word.

1statusColumn({2  into: "name",3  header: "Outcome",4  status: (row) => (row.denied ? { label: "Denied", color: "error", tooltip: "Permission denied" } : { label: "Allowed", color: "success" }),5})

The parts, by hand

Table, TableHeader, TableBody, TableRow, TableHead and TableCell are the same table with no card and no engine: for the small table inside a row's details. Its columns are a grid template from tableTemplate. A list is never built from these.

1<Table style={{ gridTemplateColumns: tableTemplate(["1.2fr", "1fr", "1.6fr"]) }}>2  {/* static and with no fill: the header of a table inside a row's details is not pinned */}3  <TableHeader className="static [background:none]">4    <TableRow>5      <TableHead>Resource</TableHead>6      <TableHead>Type</TableHead>7      <TableHead>Access</TableHead>8    </TableRow>9  </TableHeader>10  <TableBody>11    <TableRow>12      <TableCell><TableLink href="…">production-gateway</TableLink></TableCell>13      <TableCell>Gateway</TableCell>14      <TableCell>All tools</TableCell>15    </TableRow>16  </TableBody>17</Table>

API Reference

DataTable

The data, and what to ask the server for next.

PropTypeDefaultDescription
columnsTableColumn<T>[]—The columns, in order. See TableColumn below.
dataT[]—The rows: the page the server answered with or, with inMemory, the whole list.
getRowKey(row: T) => string—A stable key per row, unique across the whole table (child rows included).
inMemorybooleanfalseThe table sorts and pages data itself, in the browser. For a short list that arrives whole.
sortTableSort—What the list is sorted by: { column, direction }.
onSortChange(sort: TableSort) => void—A header was pressed.
paginationTablePagination—The footer and its pager: page, pageSize, total, onPageChange, onPageSizeChange, pageSizes, and for a list paged by cursor hasNext with no total (no count and no page of pages). A list too short for a second page at any size keeps the count alone. Left out: no footer.
loadingbooleanfalsePlaceholder rows in place of the data; the body is marked busy.
defaultSortTableSort—Where an inMemory table starts, when the page does not hold the sort itself. Unset, it starts on its first sortable column, ascending. A table always opens sorted: a list by its name, a log newest first.

The bar over the rows.

PropTypeDefaultDescription
header"inside" | "outside""inside"Where the bar sits: the card's top, or over the card.
titlestring—The list's title, at the bar's left: its words only. The Table draws them as the Card draws its title (label-2, 13px, neutral-fg).
titleBadgesReactNode—Badges after the title, as on the Card's and the Modal's titles: one, two or three real Badges, passed through. How many the list holds is the first of them, when the screen knows the number.
titleHelpstring—What the list is, in a sentence: an (i) right after the title's words (the IconTooltip, as a column's help), before its badges and the search: 8px after the words (TITLE_HELP_GAP), 10px before the search (TITLE_HELP_AFTER). The words cut; the (i) keeps its room.
tabsTableTabs—A split of the list: value, onValueChange, items and a label for assistive tech. A filter with no chip.
searchReactNode—The search field (a ds Input at sm). Its width is the bar's to give.
filtersReactNode—The Filter button, at the bar's right with the columns control, after the page's buttons.
fields[].conditionsstring[]—On one of the Filter's fields: the conditions it offers, by id, when it offers fewer than its kind. ["is"] keeps “is” and “is any of” and drops “is not”, for a list whose server can't exclude (Rulings' Agent). Unset, every condition its kind has; a link that asks for another drops that filter.
actionsReactNode—The page's own buttons for the list, at the bar's right, before the Filter and the columns control.
filterChipsReactNode—The filters in effect, in a row under the bar. Drawn only while it renders something.
exposedFiltersTableExposedFilter[]—Filters shown on the bar itself, a select each, before the Filter button: { id, label, value, onValueChange, options }. The trigger says what it is about (“Type: All”); one choice, the clearing one first; a choice can end in a badge in the menu. No chip, and Clear leaves it alone.
noteReactNode—A line about the list as a whole (“14 hidden by filters — Clear filters”): in the footer, after the count.
toolbarVariant"secondary" | "ghost""secondary"The look of the toolbar's own buttons (the columns control, the folded search).
columnsMenubooleantrueThe columns control, after filters and before page actions. A screen leaves it on; false is for a table the designer has said is too small for it.
columnVisibilityRecord<string, boolean>—Which columns are on, by id, when the page keeps it itself. A screen does not pass it: which columns show is the person's, for as long as the page is open.
onColumnVisibilityChange(visibility) => void—The columns menu changed what is on.

Width, height and motion.

PropTypeDefaultDescription
overflow"responsive" | "scroll"—What the columns do once none can get narrower: go on down the ladder (behind “+N”), or scroll sideways. Either way they take their narrower forms first, as far as the layout's floors (TABLE_FLOORS; see How a table narrows). Unset, it is the person's one choice for every table (the app's TableViewProvider), responsive until they change it. A screen does not pass it.
onOverflowChange(overflow) => void—With a set overflow, shows the Responsive switch in the columns menu.
cutColumnnumber | false2/3A table that scrolls sideways ends inside a column, this share of it in view, so its edge never falls between two columns. The columns before the cut one grow by a few px each to place it, with the table's motion, when the table arrives in that state. While its width is changing the cut is off; it is placed once the width has rested. Its sideways thumb shows under the pointer only. false: the edge falls where it falls.
motionTableMotion—How a ladder step moves: duration in ms (760) and spring (0.32).
heightnumber | "fill"—The rows' area's height, header row included. Short of rows, empty ruled rows fill it: whole ones at a row's height, then plain space; a line is never drawn half a row or less from the footer's.
minRowsnumber—With height="fill": the fewest rows the table keeps room for. Its parent shorter than that, the table stops shrinking and the page scrolls instead (a page with something tall above its table; Agents keeps four).
maxHeightnumber—Hugging its rows, the tallest the area grows before the rows scroll.
scrollAreaScrollAreaSettings—The scroll area the rows scroll in: its look, and when its thumb shows (revealUntilScrolled: true, a storage key or false; scrollbar, always or hover, once that is false). Unset, the table's own (TABLE_SCROLL_AREA): the cover over every edge the rows run on past with Responsive off, and the thumb under the pointer only.

Rows: where they go, what they open, what they can do.

PropTypeDefaultDescription
rowHref(row: T) => string | undefined—Where a row goes: its name becomes a real link.
rowLinkElementType"a"The link's element, for a router's link.
onRowOpen(row: T) => void—What a row opens instead of a page (a panel): its name becomes a button.
canRowOpen(row: T) => boolean—Which rows onRowOpen is for; unset, all of them.
isRowActive(row: T) => boolean—The row a panel is showing: it stays marked.
rowLabel(row: T) => string—The link's or button's name for assistive tech, when the main cell's text isn't one (a log's time or id).
rowBadge(row: T) => { label, tooltip, color? } | null—One badge beside a row's name, for what marks that one row (the default): after the name and its status dot, before the “+N”, small, never cut. Anything that varies across rows is a column.
rowDescription(row: T) => string | null | undefined—A second line under the row's name: read, never pressed (body-2 in neutral-fg-secondary), cut with an ellipsis. The status dot and the “+N” stay on the name's line. A table with a line under any row's name, a child row's included, is large: every row 56px, parents and children alike, so a row with none lines up.
rowActions(row: T) => TableRowAction[]—What a row can do, as data. One shows as its button; two or more as the three dots.
getSubRows(row: T) => T[] | undefined—A row's child rows: it then opens to show them, one step in.
rowDetail(row: T) => ReactNode—A row's panel under it. Nothing returned: that row doesn't open.
groupTableGroup<T>—Puts rows under bands: id(row), and label(id, rows) for the band's name.
expandedRecord<string, boolean>—What is open, when the page keeps it: a row's key, and group:<id> for a group.
onExpandedChange(expanded) => void—Something was opened or closed.
defaultExpandedRecord<string, boolean>—What starts open, when the table keeps it.

Selection.

PropTypeDefaultDescription
selectablebooleanfalseA checkbox on every row and in the header.
reorderTableReorder—Rows a person drags into a new order: { onOrderChange(keys), disabled?, help? }. The drag column comes first (before the selection's), a grip on every row centred under its header, the (i) there when there is help. Arrow keys on a grip move its row by one; Escape puts a held row back. The page keeps the order; the table sorts by nothing and shows all its rows. disabled keeps the grips, disabled: under the pointer they show the not-allowed cursor and the reason in a tooltip. An enabled grip has no tooltip: the hand says what it does.
selectionTableSelection—What is selected, when the page keeps it: { mode: "rows", keys } or { mode: "all" }.
onSelectionChange(selection) => void—The selection changed, by a click or by the table's own rule (a new page clears it).
selectionScopestring—The list's search and filters as one string. A new value clears the selection.
bulkActionsTableBulkAction[]—What can be done with the selected rows. While something is selected the bar gives way to the selection's line: the count, these, and Clear.
bulkActionsDisplay"menu" | "exposed""menu"One “Actions” menu, or the first two as buttons and the rest behind “More”.

With no rows, and the rest.

PropTypeDefaultDescription
emptyStateTableEmptyState—The ds EmptyState's props, drawn in place of the rows when there are none; in a table with a height it is centered in that height.
emptyCard"outline" | "default""outline"The table's card while it holds the empty state. A list whose filters match nothing keeps its card ("default"), as Agents does: it is still the list, with its bar to change the filter.
emptyDisplay"state" | "line""state"How the empty state is drawn: the EmptyState, or its heading alone on one 32px line, for an empty table that shares its page with one that has rows. When to use the line is not a rule yet.
emptyMessagestring—One line in a row under the headers, instead of an empty state.
classNamestring—On the table's root.

TableColumn

PropTypeDefaultDescription
idstring—The column's key: in sort, columnVisibility, merge.into.
headerReactNode—The header's label.
cell(row: T, form: number) => ReactNode—The cell. form is the index of the width the column is at: 0 where there is room.
widthnumber | readonly number[]120Its width in px, or its width at each form, widest first. One width: the Table adds a narrower form itself, its header cut to a few letters or to its icon, never narrower than its values need, so every column narrows before any leaves.
resizeMinWidthnumber—With Responsive off, the narrowest a person may drag this column, px, when it must stay wider than its header's smallest form. Unset, a column stops at that form.
growboolean—Takes the room the others leave. More than one growing column shares it.
primaryboolean—The row's primary value: it receives the row link or panel action. Defaults to the growing column, then the first shown column.
align"start" | "end"—end sets the column against its right edge: every number (numberColumn sets it). Unset, the last data column showing aligns end and every other aligns start, a date's included.
sortableboolean—Its header sorts. Unset: every column of an inMemory table sorts; a list the server sorts sorts only the columns that say so. false: it never sorts (an endpoint).
sortValue(row: T) => string | number | Date | null—What an inMemory table sorts the column by.
labelstring—The column's name where the header can't say it: the columns menu, its icon's tooltip, its line behind “+N”.
iconIconComponent—The header's icon, its label in a tooltip. With Responsive on it stands in for the word in the column's icon form, once the word cut to three letters has no room; with Responsive off a header keeps its word.
helpstring—What the column means, in a sentence: an (i) beside the header's word, its tooltip: word, (i), sort marks, away from the side the header is aligned to.
text(row: T) => string | null—The cell as plain text: its line in the “+N” tooltip while the column has no room. A cell that is already plain text needs none; any other column that can leave says it here.
least(row: T) => string | null—The value's shortest whole form, as text (1.3K, 11/12/26): never cut, so the column is never narrower than it. numberColumn, dateColumn and agoColumn give it.
link(row: T) => { href, label? } | undefined—Where the value goes. While the column isn't showing, the row's actions gain “Go to <column>”.
merge{ into, width, cell, order? }—Joins another column's cell as a guest when it gives up its place. For a status only.
prioritynumber—1 is the most important. The least important takes each kind of step first.
ladderreadonly number[]—Numbers this column's steps on the table's ladder outright. Lower goes first.
hideablebooleantruefalse: always shown, and absent from the columns menu.
checkboxbooleanfalseA checkbox per row that isn't the selection (a pick to compare): as wide as the selection's column, 16px from the next, always shown, never sorted.
defaultHiddenboolean—Starts hidden, until the columns menu turns it on.
classNamestring—On the column's cells.

The header cell

A column's header: its word, then, as the column narrows, its word cut, then its icon alone (with Responsive on). The column's form decides which, so a header never turns back and forth while a width is dragged. A header that sorts does so on a click anywhere in it; the sort triangles show on the sorted column and on the one under the pointer. A screen sets these on the column.

PropTypeDefaultDescription
headerReactNode—The column's word. Text, so the Table can cut it and measure it.
labelstring—Its name where the header can't say it: the icon's tooltip, the columns menu, its line behind the “+N”.
iconIconComponent—Stands in for the word in the column's icon form (Responsive on), its label in a tooltip.
helpstring—What the column means, in a sentence: an (i) beside the header's word (the IconTooltip), its tooltip: word, (i), sort marks, away from the side the header is aligned to (end-aligned: marks, (i), word). The word cuts before it; in the header's icon form it goes with the word, and the icon's tooltip says it.
sortableboolean—Its header sorts on a click anywhere in it: ascending first, then the other way.
sortValue(row: T) => string | number | Date | null—What an inMemory table sorts the column by.

The cell

A cell holds a value and nothing else: the Table draws its type, its color and its padding (12px a side, 8 at the column's narrowest). A row is md (one line, 36px) or large (the name and a line under it, 56px), the whole table one or the other. The content is injected: the column's cell gives it, and the pieces below draw what a value needs.

PropTypeDefaultDescription
cell(row: T, form: number) => ReactNode—The value, and nothing else: the Table sets its type, color and padding. `form` is the width the column is at, 0 where there is room.
widthnumber | number[]120Its widths, widest first; past them the Table narrows it to its floor and draws its last form, cut.
align"start" | "end"—Where its value sits. A number aligns end wherever it is (numberColumn sets it). The last column showing aligns end unless it says otherwise; a date sets none, so it is left unless it is last; the name never aligns end.
text(row: T) => string | null—The value as plain text, for a drawn cell: its line behind the “+N”.
least(row: T) => string | null—The value's shortest whole form, never cut: the column is never narrower than it.
rowDescription(row: T) => ReactNode—On the table: a line under the name, which makes every row large (56px, two lines). Without it a row is md (36px, one line).
rowAvatar(row: T) => AvatarProps | null—On the table: one Avatar before the name, xs unless it names another size.
rowBadge(row: T) => { label, tooltip, color? } | null—On the table: one badge after the name, for what marks a single row of the list.

What a cell holds

The pieces a column's cell draws a value with, each above the row's target so its click is its own. Plain text needs none: the Table cuts it.

PropTypeDefaultDescription
TableLink<a> props, as?—Another link in a row, for a value that goes somewhere in the product. label-2, the link color while its row is under the pointer. `as` is a router's link.
TableCodeCopy<span> props—A value to paste: a TableInlineCode and a TableCopyButton, 6px apart. The button shows with its row and keeps its place, so the code is cut to what it leaves; under 42px of room the button goes and the code takes it.
TableInlineCodeInlineCode props—A code on one line, cut to its cell, in the secondary text: an endpoint, an id.
TableCopyButtonCopyButton props, less emphasis, size and color—The row's copy button, shown with its row: the CopyButton as a link, its 12px icon alone, gray, with no box and a 24px target. 6px after its value: a text, a link or a code.
TableStatus{ color?, dot?, dotOnly?, children }—A status as its dot and its word. dotOnly: the dot alone, the word in a tooltip.
TableStatusDot{ color?, dot?, label }—A status folded to its dot (14px with its tint), named by `label` (“Status: Active”), a tab stop with a tooltip.
TableShort{ full, children }—A value in a shortened form (293.8K), the whole one in its tooltip under a dotted line. Nothing when the two are the same.
TableNonenone—Nothing to show: the short dash, muted.

Predefined columns

Columns the Table writes itself: a screen says which value, and the Table writes it at each of the column's widths, its text behind the “+N” and its shortest whole form. Each takes any other column option (id, header, icon, priority…). The Gateways, Tools and Models examples in the playground use them.

PropTypeDefaultDescription
statusColumn{ status, into, ...column }—A status: a badge with its dot and word; `status(row)` gives the word and color, a `tooltip` for the reason behind it (the badge then ends in the info icon and shows the reason on hover; the folded dot says it after its word), or null for the dash. Short of room it folds into `into` (the name) as its dot.
dateColumn{ date, none?, ...column }—A date the Table writes at each width: November 12th, 2026 → Nov 12, 26 → 11/12/26. `none` is what a row with no date says.
agoColumn{ date, none?, ...column }—How long ago, counted from when the columns were built: 3 hours ago → 3h ago → 3h.
numberColumn{ value, format?, color?, ...column }—A count: whole where there is room, then compact (123,456 → 123.5K) with the whole number alone in a tooltip ("123,456": the header says what it counts). `color: "error"` puts a count that means trouble (denies) in the error text color; a zero keeps the cell's. Zero is 0; only a row with no number (null or undefined) is the dash.

The other types

TypeShape
TableSort{ column: string; direction: "asc" | "desc" }
TablePagination{ page?, pageSize?, total?, onPageChange?, onPageSizeChange?, pageSizes? }
TableRowAction{ label, icon, onClick, variant?: "default" | "destructive", disabled?, labelled? }
TableBulkAction{ label, icon, onClick(selection), variant?, disabled? }
TableSelection{ mode: "rows"; keys: string[] } | { mode: "all" }
TableTabs{ value, onValueChange, items: { value, label }[], label }
TableGroup<T>{ id: (row) => string; label?: (id, rows) => ReactNode }
TableMotion{ duration?: number; spring?: number }
TableEmptyStateThe EmptyState's props, without className.

Also exported: the column helpers that write a value at each of its widths (statusColumn, dateColumn, agoColumn, numberColumn), the cell pieces (TableLink, TableShort, TableNone, TableStatus, TableStatusDot, TableCopyButton, TableInlineCode, TableCodeCopy), TableViewProvider (the app gives the store that keeps the person's one Responsive choice), the parts (Table, TableHeader, TableBody, TableRow, TableHead, TableCell, TableSortHeader), and the helpers tableLadder, tableTemplate, tableActionsWidth, TABLE_SELECT_WIDTH and TABLE_SCROLL_AREA. Dates, numbers and relative times in their shorter forms come from ds/lib/table-format.

Accessibility

KeyDoes
TabMoves through what can be pressed, in reading order: the toolbar's controls; per sortable header its label, then its two sort triangles; then per row its checkbox, name, other links and its action button; then the footer.
Enter, SpaceOn a header's label, sorts by it (again: the other direction); on a triangle, sorts that way. On a name, follows the link or opens the panel. On a chevron or a group's band, opens or closes it.
SpaceOn a checkbox, checks the row. Shift-click with the pointer takes the rows in between.
↓ ↑, EscIn a row's menu, the bulk Actions menu, the columns menu or the Filter menu: the Dropdown menu's own keys.
EscIn the folded search, closes it.

Table semantics. It is a table with column headers, rows and cells, and a sorted header says its direction (aria-sort). A sortable header's one button is named by the column's label and takes the whole cell: a first click sorts ascending, the next flips it. The triangles are drawn, not buttons.

What is pressed is a real control. A name that goes somewhere is a link; one that opens a panel is a button that says a dialog follows and whether it is open; a row that opens in place has a button with aria-expanded. A row's checkbox is “Select row”, or “Select” and the row's rowLabel when the list gives one; the header's is “Select all on this page”. The row actions are always in view.

Under the pointer only. A column's help, and the whole number behind a shortened one, are tooltips with no tab stop: the keyboard does not reach them. What is behind “+N” is in its tooltip, and it lists those values in its name for a screen reader; on a touch screen it cannot be read. The folded status dot is a tab stop, with a name.

Motion. The ladder's travel, the rows that open and the pager's ease all cut under reduced motion.

Not there yet. The table has no accessible name, the name cell is not marked as its row's header, a loading table says nothing, a table in scroll mode cannot be scrolled sideways from the keyboard, and the toolbar's tabs are announced as tabs though they have no panel. The first four are rows under What others expose. Not checked at all: a screen reader, touch, Safari and Firefox.

Rules

Open questions

An empty cell: a dash, or nothing?

Open
Ours

The short dash, muted (T1 writes it so). Whether it stays a dash is open with the designer.

Other systems

Primer leaves an empty cell blank by default, or shows a message, because a lone character reads oddly to assistive technology.

What is behind “+N” is only in a tooltip

Open
Ours

The values of the columns that gave way show in the tooltip of the row's “+N”, and nowhere else on the row.

Other systems

The Tooltip's own page says a tooltip adds and never carries, and that a touch screen shows none. On touch those values cannot be read.

Tabs that filter

Open
Ours

The toolbar's tabs filter the list. They are drawn as the simple tabs, announced as tabs with no panel, and become a select when they do not fit.

Other systems

The Tabs page leaves open how a tab used as a filter should be announced, names the segment look for a list's split, and has no rule for tabs that do not fit.

Color and text

T1 — In a table, neutral-fg means “this goes somewhere”

Do: what is only read is neutral-fg-secondary, and it is body-2: every value. “Nothing” is the muted dash: a value that is not there (not applicable, never happened). A count of zero is a value and reads 0 (numberColumn writes both). A cell says its value alone, never its header again: under “Events” it is 5, not “5 events”. A shortened number's tooltip is the whole number alone, “123,456”, never “123,456 tokens”: the header already says what it counts. An inline code is the secondary text too (TableInlineCode sets it), and a badge keeps its own colors. Only what can be clicked is neutral-fg, and it is label-2: the row's name, a link in a cell. A group band's title is neutral-fg too. The Table sets all of it: a cell sets no type, no weight and no color. A row with details under it also keeps its name neutral-fg.

Don't: use text-neutral-fg, a label role or a weight (text-label-2, font-medium) for a value, a number, a date or an owner's email, or make a link of a value that is not a destination. Don't show the dash for a zero, and don't repeat the header's word in a cell (“5 events” under “Events”) or in its tooltip (“123,456 tokens”).

T2 — A link turns the link color when its row is hovered

Do: make the row's name a link with rowHref and rowLink (or onRowOpen for a panel), and any other link a TableLink. Every link is the same: label-2 in neutral-fg at rest. While its row is hovered, focused or has its menu open it turns --table-link-hover (the link purple, --link): the color alone, never the size or the weight. Under its own pointer it turns --table-link-pointed (the link's hover purple). Always --table-link-hover on touch.

Don't: underline it, dot it, or color it at rest; write a purple by hand (text-link, or --primary-fg, which is the title color); or put your own <a>, Link or ScopedLink in a cell.

T3 — What opens in place gets brighter, never colored

Do: brighten on the row's hover. A parent row's title goes from neutral-fg-secondary to neutral-fg, and a chevron and a group's count from neutral-fg-muted to neutral-fg. A parent row that is also a page has a link for its name (T2), and its chevron alone expands it.

Don't: give the link color to something that opens here. Color means you go somewhere; brightness means it opens here.

Rows and actions

T4 — The name is what you click, not the row

Do: make the first column's name the click target. A group band is clickable across its whole width. A row that goes nowhere keeps its hover tint and a secondary name.

Don't: make the whole row a link, or show a pointer on a row that goes nowhere.

T5 — The header sorts, and stays in place

Do: sort on a click anywhere in a header cell. Show the sort triangles on the sorted column and on the hovered column only (the pointer anywhere in the column counts). Keep the header pinned and opaque, with the scrollbar starting under it.

Don't: show triangles on every column at rest, or print a word over the Actions column.

T6 — Row actions: one icon, or the three dots

Do: draw one action as an icon button, and two or more as the three dots alone, always visible. A labelled action is a ghost button with its word, chosen per table, in the error text color when it destroys. In the menu: safe actions, then “Go to” links, then destructive ones under a line. A link whose column is hidden becomes “Go to <column>” there. Pass them as rowActions: the Table draws the column.

Don't: put two icon buttons side by side, show actions only on hover, or build an actions column or a menu in a cell.

T7 — Bulk actions: one “Actions” menu, or two buttons at most

Do: put bulk actions under one “Actions” menu. Exposing them is an option: at most two separate 28px buttons, then “More”, destructive last. While rows are selected the bar gives way to the selection's line: the count at the left (“5 of 40 selected”), the actions and Clear at the right. Selection is by checkbox, per page; the footer keeps the total and offers “Select all N” after it, for everything that matches.

Don't: use a button group for bulk actions, or expose a third button.

Cells

T8 — A tooltip only where something is cut or has no name

Do: show one on cut text, an icon-only header, a column's help (its (i)), the folded status dot, an icon mark, and a status's reason (statusColumn's tooltip: “Permission denied” on a Deny): its badge ends in the info icon, and the reason shows on hovering the whole badge. Put the dotted hint only under a shortened number, and only while its row is hovered.

Don't: put a tooltip on a relative time, a whole number or a date, or use the help cursor.

T9 — A table's badge is a word or an icon, never both, and always one size

Do: write a status and a type as badges with their word alone. A badge that is an icon alone is fine. Every badge in a table is md (20px): the Table sets it. A status column is a badge with the status dot (statusColumn); the dot is not an icon. When the table runs short of room the status folds into the name's cell, first after the name, as the dot alone with a “Status: <value>” tooltip. The one badge with an icon beside its word: a status that has a reason (statusColumn's tooltip) ends in the info icon, and the reason is the badge's tooltip; a status with no reason shows neither. One badge beside a name is allowed only when it marks a single row of the list (the default): the Table's rowBadge, after the status dot, never cut. A state that varies across rows (“Unreachable”) is a column of its own. When the table has no other status, that state is its status column, with the dash for a row that has nothing to say (status answers null); when it has a real status too, the marker is a plain column that goes behind the “+N”.

Don't: put an icon beside a badge's word, set size on a badge in a table, draw a status another way, or draw a badge in the name's cell yourself. An icon beside a word is decided case by case, with the designer, and a decided case is marked in the code where it is.

Layout

T10 — One Table for every list, in a card

Do: use the ds DataTable for every list, in a card with the card inset left and right and 28px controls in its toolbar. The toolbar is one row: the title, then the search, at the left; the tabs, the page's buttons, then the Filter button and the columns control at the right. Pagination always shows the count and the rows per page, and the page text with Previous / Next only past one page. A box that opens under a row has no fill, and a line hangs from the chevron. An empty table draws EmptyState, and its card becomes an outline.

Don't: build a table by hand, or fill the box under a row.

T11 — The table's title is the Card's title: words, then badges

Do: pass the title as words. The Table draws it as the Card draws its title, label-2 (13px) in neutral-fg, then any titleBadges: one, two or three Badges of your own, as on the Card's and the Modal's titles. How many the list holds is the first of them, when the screen knows the number.

Don't: pass an element or a class for the title, set its type in a screen, write a number into the words, or count one page's rows as the total.

T12 — Columns give way in a set order

Do: let each column step down in this order: its value shortens, its header is cut and then becomes its icon, then it goes behind the “+N” badge that ends the name cell, on the rows that have a value there. Only a status joins the name cell, as its dot, before it would go behind “+N”; a column's merge says so. A link column that gives way does both: its value counts in “+N” and shows in the “+N” tooltip, and “Go to <column>” appears in the row's actions. Every table says the order: priority on each column (1 is the most important and leaves last), or ladder to number each step. A date, a time-ago and a count are the Table's own columns (dateColumn, agoColumn, numberColumn): they shorten by themselves before the column leaves. A column whose cell is drawn (a badge, a link) says its value as text too, or it has no line behind the “+N”. The shortening is every table's, as far as the layout's floors go (“How a table narrows”, above): with Responsive off a header keeps its word and a value keeps ten characters. A table is overflow="responsive" by default: past the shortest forms its columns give way and it never scrolls sideways. overflow="scroll" is the other mode: past the shortest forms nothing leaves and the table scrolls sideways, with the hovered row's actions floating at the right edge. Where the shorter forms alone fit, the two are the same table. A column that gives way travels: its values move into their row's “+N” and come back out of it, a status moves to the name and back, and the “+N” stays in view. It takes motion.duration (760ms) and the “+N” springs by motion.spring (32%); under reduced motion everything cuts.

Don't: drop a column with no “+N”, fold anything but a status into the name cell, pin the first column, or let a responsive table scroll sideways or mix the two modes.

T13 — Filters: one Filter button, chips under the bar

Do: offer one Filter button: its icon always, a label when there is room. The icon turns primary while a filter is on. Pick a field, then tick its values in the submenu that opens beside it; the condition starts at “is”. Filters show as chips in a row under the bar, each removed with an x, and between filters it is AND. A split like All / Managed / External is the tabs at the toolbar's right, before the Filter button: it still filters, with no chip.

Don't: write the button as text alone, put a count on it, put single fields out on the bar, or run two filter systems on one bar.

T14 — Every table has its columns control, and Responsive is one choice for every table

Do: keep the Table's columns control (which columns show, and Responsive on or off). Responsive is one choice per person for every table, on by default, kept in their preferences: turning it off on any table turns every table to the sideways scroll, and back. Which columns show lasts as long as the page; a refresh brings the table's defaults back. With Responsive off a table ends two thirds into its last column's widest value, under the cover (SCROLL_AREA_PRESETS.cover) on every edge its rows run on past: the sides and the bottom, the top once scrolled. A responsive table has no sideways fade; its rows keep the cover above and below.

Don't: pass overflow or columnVisibility from a screen, switch the columns menu off, or save a column choice.

T15 — Numbers and the last column sit against the right edge

Do: write a number with numberColumn, which right-aligns it wherever its column is; a number in a drawn cell sets align: "end". Leave the last data column's alignment to the Table: it right-aligns the last one showing, header and values, and puts the row's actions after it. When that column gives way, the one before it takes the edge. A date is not a number here: left, or right as the last column, and its column never sets align. An email column may sit right. The last column right-aligns every value it holds with its header: a badge (a status included) and short text, a word or two. Only long text (a sentence, a description) stays left.

Don't: set align: "start" on a number or on the last column. The name is never right-aligned, even when it is the only column left.

T16 — A table opens sorted by something, and shows it

Do: open a list of things by its name, A to Z, and a log (recent calls, events, runs, deliveries) newest first. The sorted column's header carries the mark. Pass sort (what the server was asked for) or, for a list that arrives whole (inMemory), defaultSort.

Don't: show rows in an order no header owns.

T17 — A name is one line; what explains it goes under it, read only

Do: keep the row's name on one line, cut with an ellipsis, whole under the pointer and on focus. A description goes on a second line under the name with rowDescription: body-2 in neutral-fg-secondary, never clickable, cut the same way. The row is then the large one (56px): the one-line row's 8px above and below the two lines. Only the name is the link.

Don't: draw a second line in the name's cell by hand, let a name wrap, or make the description part of the link.

What others expose

What shadcn, TanStack Table, Atlassian, Primer and Polaris have that ours does not. Polaris is read from its published package (its site redirects elsewhere) and Primer's props from its repository; Base UI has no table. Nothing here is decided for us, and nothing was added: “Ours differs” says what ours does instead, “Ask” is a question for the designer.

They haveWhoOursWhy
A name for the table itselfAtlassian (caption or label), Primer (labelled by its title), shadcn (TableCaption)AskOurs has none.
The name as a row headerPrimer (rowHeader)AskOurs is a plain cell.
A spoken loading stateAtlassian (loadingLabel); Primer's accessibility guidanceAskOurs marks the body busy and hides the placeholder rows; nothing is said.
A sideways scroller that takes keyboard focusPrimerAskOurs cannot be scrolled sideways from the keyboard in scroll mode unless focus is on something in a row.
Descending first, per columnTanStack (sortDescFirst), Polaris (defaultSortDirection)AskOurs sorts ascending on the first click, for every column.
Some rows not selectable; one-row selectionTanStackAskOurs selects any row, any number.
Sorting by several columnsTanStack (Shift-click)Ours differsOurs sorts by one column.
A third click that clears the sortTanStackOurs differsOurs goes between ascending and descending. Primer says one column must be sorted by default.
Pinned columnsTanStack; Polaris (fixed first columns on its data table, a sticky last column on its index table)AskOurs pins none; the table rules say not to pin the first (T10). In scroll mode the hovered row's action floats.
Columns resized by handTanStackOurs differsOurs sets widths from the columns' own forms.
Columns reordered by the personTanStackAskOurs shows them in the order given; the columns menu turns them on and off.
Drawing only the rows in view; endless scrollTanStack, with a second libraryOurs differsOurs draws every row it is given, and pages.
DensityPrimer (cellPadding: condensed, normal, spacious), Polaris (increasedTableDensity)AskOurs has one row height.
Zebra stripesPolarisOurs differsOurs rules its rows and tints the hovered, the selected and the active one.
A totals row, a table footerPolaris, shadcn (TableFooter), TanStack (a column's footer)AskOurs has no totals row; its footer is the pager.
Rows reordered by draggingAtlassian (isRankable)Ours differsOurs has none.
A tone for a whole rowPolaris (a row's tone), Atlassian (a highlighted row)AskOurs tints a row only as hovered, selected or active. Atlassian's own guidance: never rely on a highlight alone for meaning.
Cells that wrapPrimer (prefers wrapping)AskOurs is one line a row: a cell is clipped, and text in a Truncate is cut with an ellipsis and has a tooltip.
Rows stacked into blocks on a phonePolaris (condensed)Ours differsOurs steps its columns down the ladder.
A failed-load statePrimer (Table.ErrorDialog)AskOurs has loading and empty, and nothing of its own for a list that failed to load.
Cells spanning columns, grouped headers, group-by chosen by the personTanStack; Atlassian (colSpan, in its types)Ours differsOurs groups rows the page groups (group) and nests child rows (getSubRows); it has no spans or header groups.
Catalog
Foundations
  • Overview
  • Components
  • Tokens
  • Token usage
  • Typography
  • Icons
Atoms
  • Avatar
  • Badge
  • Button
  • Checkbox
  • Color picker
  • Copy button
  • Icon tooltip
  • Inline code
  • Input
  • Hint
  • Kbd
  • Loader
  • Native select
  • Progress bar
  • Progress ring
  • Radio
  • Select
  • Status dot
  • Switch
  • Text link
  • Textarea
  • Tooltip
  • Truncate
Molecules
  • Accordion
  • Activity chart
  • AI elements
  • Alert
  • Button group
  • Card
  • Code block
  • Combobox trigger
  • Command
  • Content table
  • Context switcher
  • Dropdown menu
  • Empty state
  • Field
  • Field group
  • Filter chip
  • Flow
  • Heading
  • Icon picker
  • Icon flow card
  • Metric card
  • Modal
  • Modal confirmation
  • Pagination
  • Popover
  • Scroll area
  • Sidebar
  • Table
  • Tabs
  • Toggle group
LibraryPublished release