DataTable
Framed dataset with search, filters, column settings, and a caption title.
Simple semantic table for invoices, lists and text rows.
Simple semantic table for invoices, lists, and text rows. Search and filters belong on DataTable. Not TableHeader/TableRow/TableCell cousins.
Invoices. Caption sits under the grid. Footer holds the total. Amount hugs the right edge. Medium rows. Variants shows sorting, states and cell values.
| Invoice | Status | Method | Amount |
|---|---|---|---|
| INV001 | Paid | Credit Card | $250.00 |
| INV002 | Pending | PayPal | $150.00 |
| INV003 | Unpaid | Bank Transfer | $350.00 |
| INV004 | Paid | Credit Card | $450.00 |
| INV005 | Paid | PayPal | $550.00 |
| INV006 | Pending | Bank Transfer | $200.00 |
| INV007 | Unpaid | Credit Card | $300.00 |
| Total | $2,500.00 | ||
Caption sits under the grid; footer holds the total; Amount hugs the right edge.
Simple semantic table for invoices, lists, and text rows, with optional sort, row menu, sticky header, loading, empty and error states, row dividers on or off, and one optional highlighted row. Search and filters belong on DataTable. One piece.
import { Table } from "agentic-ds-kit";From contracts/table.json: must is the a11y requirements, defaults the prop defaults, stops if the doNot rules where the agent asks instead of inventing a cousin.
| Name | Type | Required | Default | Notes |
|---|---|---|---|---|
| columns | array | Yes | — | numeric or align end right-aligns the column and its header (a sortable number header keeps its icon on the right). emphasis or the first column is medium + text-primary. sortable makes the header a button: ascending, descending, then off (local state only). sortValue returns what to sort by (numbers and Dates compare numerically, strings locale-aware); without it, a numeric column sorts by the digits in its text and others by text. sortValue is a function, so build the columns in a client component. |
| rows | array | Yes | — | Values render in native td. Plain strings and numbers, or ReactNode such as kit Cell (badge, avatar, link) or Badge. The first column's text (or its Cell label) names the row. |
| caption | string | No | — | Renders below the grid (caption-side bottom). Not a heading above the table. |
| size | sm | md | lg | No | md | md rows and header are 40px, one line. sm a hair tighter, lg a hair roomier. Do not recreate DataTable 3–4rem rows. |
| emptyLabel | string | No | No results. | Shown as a small Empty (kind no-data) in one td with colSpan when rows is empty or state is empty. Say why it is empty. |
| footer | object | No | — | Renders tfoot one row: label in a td colSpan={columns.length-1}, value in last td end-aligned. |
| stickyHeader | boolean | No | false | The header row stays in view while the body scrolls. Give the Table a height (style or className) so the region scrolls. |
| rowActions | function | No | — | (row, index) => CellAction[]. One row menu (Cell type actionMenu) in a last 56px column with no visible header text, named Actions for <first cell>. Return [] to leave a row without a menu. |
| rowActionsAs | menu | icons | No | menu | menu: one row menu (Cell actionMenu). icons: each action as an icon-only ghost Button (Cell actionIcons, up to 3), named by its ariaLabel, like Edit Onboarding part 2 of 3, 15 Dec. Use icons for one or two row actions the person scans for; the column stays 56px with no visible header text, so footer totals stay under their column. |
| state | loading | empty | error | No | — | loading: header stays, rows are Skeleton bars, region aria-busy. empty: Empty with emptyLabel. error: LoadError with errorMessage and onRetry. Without state, rows render (and rows=[] is empty). |
| errorMessage | string | No | Couldn’t load this table. | state error: what failed, named, like Couldn’t load invoices. |
| onRetry | function | No | — | () => void. state error: shows the Try again Button. |
| stack | boolean | No | false | Opt-in. Below 480px (container width) each row stacks into two lines: the first column and the last number column on top, the other columns below in small muted text. Headers stay for screen readers. |
| rowHref | function | No | — | (row, index) => string. The first cell becomes a link to the row. With stack, the whole stacked row is the link target; the row menu stays its own control. |
| rowTone | function | No | — | (row, index) => "default" | "highlight". highlight draws the row as a rounded shape (radius.surfaceSm) tinted with status.infoSubtle and edged all round with status.infoBorder, so it reads with or without row dividers. Use it for the one row the person should look at first, like the next charge. Without it, every row is default. |
| rowDividers | default | none | No | default | none drops the lines between body rows (the header and footer lines stay) and rounds the hover tint. The header turns compact: labels sit space.2 over the header line, and space.3 separates that line from the first row. Rows read by spacing. Use it for short lists inside a Card. |
| headerDivider | default | none | No | default | none drops the line under the header row, so the header sits flat with the rows. Body row lines stay; rowDividers controls those. default keeps the header line (no change for existing tables). |
Framed dataset with search, filters, column settings, and a caption title.
An editable table: people click a cell to add or change its content, like rule conditions, line items, or mappings.
Metrics strip of kit Scorecards: two to six figures, and the only metric picker.
One labeled control with optional hint and an error or success message.