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.
A list of records, one row each: primary and optional secondary line, leading avatar or icon, trailing value, badge, actions, or chevron.
A list of records, one row each. Not Table. Not TreeView. Not the list-detail pattern.
Primary and secondary lines, kit Avatar, optional Badge, and at most two trailing actions.
Use for people, files, and other records. Use Table when values line up in columns. Use TreeView for a nested hierarchy. Use the list-detail pattern when a pane sits beside the list.
import { ListView } from "agentic-ds-kit";From contracts/listview.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 |
|---|---|---|---|---|
| items | array | Yes | — | Leading media is Avatar when name, src, or initials is set; otherwise Lucide icon; otherwise none. One leading slot. item.group matches groups[].id. At most two trailing actions render as kit Buttons; more go in kit DropdownMenu. Icons: A curated Lucide name (PascalCase or kebab-case) renders instantly; any other Lucide name needs import "agentic-ds-kit/icons-on-demand" once (otherwise it is skipped with a dev warning). Or pass the Lucide component (Plus) or an element. dot is a small status dot as the leading mark when there is no avatar or icon; it is aria-hidden and its tone is added to the row name (Note, Good, Warning, Problem, Info). The primary or secondary text must still say the status. meta is short muted text at the row end, like a relative time, read after the secondary line. priority shows a three-bar marker in the leading slot when there is no avatar or icon (it wins over dot), is aria-hidden, and starts the secondary line with High, Medium or Low, so the word is always visible and in the row name. primaryAction is the row's one verb: an outline kit Button in a fixed 96 lane at the row end; once any row has one, rows without one keep the empty lane, so badges, values and verbs line up across rows. When primaryAction is set, every entry in actions goes in the kit DropdownMenu. At size lg below --grid-breakpoint-sm the primaryAction drops to a full-width line under its row, and below --grid-breakpoint-sm the empty lane on rows without one is hidden at every size. actionLabel on an action is the button's accessible name when the visible label is not enough on its own: visible "Review", accessible name "Review Tax checker". Start it with the visible label. Leave it out and the button keeps its visible text. value is the row's amount or figure, like "$2,418.00", on the right of the primary line in tabular figures; meta and badge stack under it, right-aligned. Format it yourself (currency, units). metaTone danger colours meta, like "17 days late"; iconTone danger colours the leading Lucide icon, like a declined payment. warning is for something waiting on someone. valueIcon is a quiet aria-hidden Lucide icon before value, like a level icon next to "Up to $250". note ends the secondary line after " · ", like "$500 asked", and noteTone colours only that part. Tones default to neutral, and the words must still say it. avatarTone is passed to the leading Avatar as tone (its fallback tint); left out, the tint is picked from the name. metaHint is the full text behind a short meta, like the exact time behind "in 4 min": it shows in a kit Tooltip while the row is hovered or has focus, with no tab stop of its own, and is read in the row name after meta. live shows note in kit ShimmerText for live status copy like "Running" (plain text under prefers-reduced-motion). metaKey names which kind of meta this is ("next", "paused", "running"): the meta keeps a one-line slot even while empty, clips with an ellipsis, and crossfades (kit BlurCrossfade) only when the key changes, so a ticking countdown never fades and the row never moves; set --listview-meta-width on the list to give every keyed meta one fixed width, so the name column never changes with the state; with metaKey, live shimmers meta instead of note. All three are off by default and change nothing when left out. toggle puts a kit Switch (sm) at the row end, after the actions, named by toggle.label; onToggle gets (itemId, checked). While a row with a toggle is the focused row, Tab reaches its Switch and actions and then leaves the list; other rows keep their controls out of the tab order, and arrow keys still move between rows. Pressing the Switch does not press the row, so the row never sinks under it. muted fades the row text to muted (a paused schedule); the words must still say it. |
| label | string | Yes | — | Accessible name for the list |
| size | xs | sm | md | lg | No | md | xs is a compact 40px row for dense cards, like a dashboard Needs attention list. lg is a touch-size row with 16/24 primary and value and 14/20 secondary and meta, like a phone record list. |
| selection | none | single | multiple | No | none | multiple composes kit Checkbox |
| selected | string[] | No | — | controlled item ids. Single keeps 0 or 1 id. Ignored when selection is none. |
| defaultSelected | string[] | No | — | uncontrolled initial item ids |
| onSelectedChange | function | No | — | (selected: string[]) => void |
| interaction | none | drill | No | none | drill shows a trailing chevron and calls onOpen(id). The row body is a button. Drill rows (unless flush) get a rounded hover and focus fill (radius.control.md) and the list insets them 4 (space.1) from its edges, so the corners never meet the container edge. |
| onOpen | function | No | — | (id: string) => void. Used when interaction is drill. |
| onAction | function | No | — | (itemId: string, actionId: string) => void |
| onToggle | function | No | — | (itemId, checked) => void. A row's toggle Switch changed. |
| groups | array | No | — | Optional section headers. item.group selects the section. total is the group's sum, like a month's amount, on the right of the header in tabular figures and part of the group's name. |
| collapsibleGroups | boolean | No | false | When true, group headers toggle their rows. Expanded by default. |
| truncate | none | secondary | both | No | none | Clip lines to one line with an ellipsis instead of wrapping (e.g. long emails in a narrow rail wrap mid-word otherwise). secondary clips the secondary line; both also the primary. The full text stays in the row's accessible name and the hover title. |
| flush | boolean | No | false | Rows meet the list's edges: square rows with a 1px rule between rows, text inset 16 at xs, sm and lg and 24 at md (where the second line tightens to 12/16), and a plain icon at its own size. A selected row fills edge to edge with a 2px brand edge on its start side. Use it in a list pane or a flush Card; the Card head or your own rules close the ends. |
| sort | none | priority | No | none | priority orders rows high, medium, low, then rows without priority, within each group. Input order is kept within a level. |
| empty | object | No | — | When items is [], ListView renders kit Empty. title is required. |
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.
Nested hierarchy people open and close level by level to browse, pick, or check items.
A list of invoices beside the one you opened.