Chat cards
Paginated table
Rows to compare across 3–6 columns. The user sorts by any column and pages through five rows at a time, inside the card. When the card is too narrow for the columns, rows stack instead of scrolling sideways.
When to use it
Section titled “When to use it”Use it when: The answer is 6–50 rows the user wants to compare across 3–6 columns (amounts, dates, statuses): unpaid invoices, usage by team, orders this week. The user sorts and pages in the card; the agent doesn’t wait.
Use something else when: Up to ~8 rows with one value each (records list). One record (entity card). More than 6 columns, filters or bulk edits (link to the page in your app, or a REPORT canvas).
What the agent receives
Section titled “What the agent receives”| The template calls | The agent gets | When |
|---|---|---|
displayed() | FUNCTION_TOOL_DISPLAYED | As soon as the card shows. Sorting and paging stay in the card; the agent already has every row. |
States
Section titled “States”Besides its data, the template draws these as itself, with mountState(). Pick one on the preview with State.
| State | When it shows |
|---|---|
| Loading | While the rows load again in place, for example after Try again. While execute runs, the SDK shows its own loader. Pass the columns and the header band shows their labels. |
| Empty | execute found no rows. The card says so and the agent explains why. |
| Error | execute returned the failure as data, so the agent can explain it. Try again loads the rows in place. |
mountState({ root, head, title: "…", state: { kind: "error", text: "…", retry } });The hosted action and the in-page handler below show each case. The state types are LoadingState, EmptyState and ErrorState in fs-kit.
DataTableData
Section titled “DataTableData”| Field | Type | Notes |
|---|---|---|
title | string | |
subtitle (optional) | string | |
icon (optional) | IconName | |
columns | TableColumn[] | 3–6 columns. More are cut. |
rows | Record<string, TableCell>[] | Every row (not one page), keyed by column id. The card sorts and pages them itself. |
pageSize (optional) | number | Rows per page. Default 5. |
sortBy (optional) | string | Column id the rows start sorted by. Default: the order given. |
sortDir (optional) | "asc" | "desc" | Default: high to low for numbers and dates, A to Z for text. |
titleColumn (optional) | string | Column shown as each row’s title when the table stacks. Default: the first text column. |
link (optional) | TableLink | A link in the header, e.g. to the full list in your app. |
TableColumn
Section titled “TableColumn”| Field | Type | Notes |
|---|---|---|
id | string | The key of this column’s value in each row. |
label | string | |
type (optional) | "text" | "number" | "currency" | "date" | "status" | text (default), number, currency, date (ISO, e.g. “2026-11-03”) or status. Numbers and currency align right. |
format (optional) | NumberFormat | For number and currency columns. Currency defaults to USD. |
sortable (optional) | boolean | Default true: the header sorts the rows. |
tones (optional) | Record<string, TableTone> | Status columns: the tone of each value, e.g. { Overdue: “error”, Paid: “success” }. Default neutral. |
TableLink
Section titled “TableLink”| Field | Type | Notes |
|---|---|---|
label | string | |
href | string |
Install
Section titled “Install”Copy the template and the shared kit into your code: agent/ui/ in an agent repo, or anywhere in your app. The template imports only ./fs-kit.js. Then wire it up from the hosted action or the in-page handler.
- Hosted action: TypeScript, JavaScript
- In-page handler: TypeScript, JavaScript
- data-table: TypeScript, JavaScript
- fs-kit: TypeScript, JavaScript
The hosted action needs an agent repo with one folder per action (agent/actions/<action_key>/index.ts). If your repo keeps its actions in agent/actions/index.ts, use the in-page handler: it runs the same template in your app.
All templates in machine-readable form: /ui-catalog/catalog.json.