Table
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.
An editable table: people click a cell to add or change its content, like rule conditions, line items, or mappings. It validates cells, can total the valid rows, and stacks below 30rem.
An editable table: people click a cell to add or change its content, like rule conditions, line items, or mappings. It validates cells, totals the valid rows, and stacks below 30rem.
Click a cell or press Enter to edit. Condition is kit Select. Add and remove rows.
| Field | Condition | Value | Remove |
|---|---|---|---|
DataGrid for in-place edits. Table for a short read-only list. DataTable for search, filters, and selection. Do not put a Field and Input on every row.
import { DataGrid } from "agentic-ds-kit";From contracts/datagrid.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 | — | type defaults to text. select needs options. date is kit DatePicker; value is YYYY-MM-DD. number and money are end-aligned with tabular figures and hold decimal strings ("18", "39.00"); money shows them in currency (default USD). compute makes a derived, read-only column such as Amount = Qty × Unit price; it is not a formula editor. validate returns a short fix ("enter 1 or more") or undefined. Do not add type formula: there is no FormulaEditor; a computed column is the only derived value. |
| rows | array | No | — | Controlled rows, one string per column key. Save with onRowsChange. Do not wrap the grid in Form. |
| defaultRows | array | No | — | Starting rows when rows is not controlled. |
| onRowsChange | function | No | — | (rows: DataGridRow[]) => void. Runs when a cell is saved and when rows are added or removed. |
| label | string | No | Data grid | Accessible name for the table, and each cell, like Value, row 2. |
| size | sm | md | No | md | Passed to HeaderCell. Edit controls are size sm. |
| canAddRows | boolean | No | false | Add row button under the grid. Not primary. New row starts empty; first cell opens for editing (when stacked, the row opens). |
| canRemoveRows | boolean | No | false | Remove control at the end of each row. Named in a kit Tooltip. |
| emptyLabel | string | No | No rows yet. | Shown in one td with colSpan when there are no rows. |
| rowNumbers | boolean | No | false | A # column with each row's number. |
| stickyFirstColumn | boolean | No | false | The # column (if shown) and the first data column stay in place while the grid scrolls sideways. |
| totals | function | No | — | (validRows) => { label, value, emphasis?, narrowLabel? }[]. Footer lines worked out from rows with no invalid cell, e.g. Subtotal, VAT 20%, Total. Values are pre-formatted. The emphasised line is the grand total and the only one shown when the grid stacks, with narrowLabel ("Total incl. VAT"). |
| errorSummary | boolean | No | false | A status line above the grid: "1 line needs a fix" / "3 lines need a fix". Empty when every row is valid. |
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.
Framed dataset with search, filters, column settings, and a caption title.
A list of records, one row each: primary and optional secondary line, leading avatar or icon, trailing value, badge, actions, or chevron.
Column header for DataTable: label, optional select-all checkbox, optional sort, sm or md.