Skip to content
GitHub (opens in a new tab)

ListView

A list of records, one row each: primary and optional secondary line, leading avatar or icon, trailing value, badge, actions, or chevron.

stableOrganismcontracts/listview.json

Preview

ListView

A list of records, one row each. Not Table. Not TreeView. Not the list-detail pattern.

Master

Primary and secondary lines, kit Avatar, optional Badge, and at most two trailing actions.

MCMaya Chenmaya@acme.com
Admin
JHJon Halejon@acme.com
PSPriya Shahpriya@acme.com
OBOwen Blakeowen@acme.com
Deactivated

Usage

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.

Do's

  • Which mark: the row dot is the leading 8px mark in a ListView row; the row text still says the status. Do not add a separate Dot.
  • People, files, or other records shown one per row
  • Pick one, check several, or open a row without comparing columns
  • valueIcon: a value column people scan by kind, like a level icon next to "On its own" or "Up to $250"
  • note with noteTone warning: one part of the secondary line waits on someone, like "Collections · $500 asked"

Don'ts

  • Values compared across columns — use Table or DataTable
  • A hierarchy visible at once, more than one level — use TreeView
  • A list plus a detail pane beside it — use the list-detail pattern
  • Ordered activity, not a record list — use Timeline
  • Picking or comparing tiles — use Card
  • App navigation — use SideNav (product) or DocsNav (docs/catalog)
  • Only the no-rows state — use Empty
  • Usage against a plan limit — use UsageList
  • Quick links in a rail — use LinkList
<ListView
  label="People"
  items={[
    { id: "maya", primary: "Maya Chen", secondary: "maya@acme.com", name: "Maya Chen", badge: "Admin", badgeTone: "info" },
    { id: "jon", primary: "Jon Hale", secondary: "jon@acme.com", name: "Jon Hale" },
  ]}
/>

When to use

  • Which mark: the row dot is the leading 8px mark in a ListView row; the row text still says the status. Do not add a separate Dot.
  • People, files, or other records shown one per row
  • Pick one, check several, or open a row without comparing columns
  • valueIcon: a value column people scan by kind, like a level icon next to "On its own" or "Up to $250"
  • note with noteTone warning: one part of the secondary line waits on someone, like "Collections · $500 asked"

When not to use

  • Values compared across columns — use Table or DataTable
  • A hierarchy visible at once, more than one level — use TreeView
  • A list plus a detail pane beside it — use the list-detail pattern
  • Ordered activity, not a record list — use Timeline
  • Picking or comparing tiles — use Card
  • App navigation — use SideNav (product) or DocsNav (docs/catalog)
  • Only the no-rows state — use Empty
  • Usage against a plan limit — use UsageList
  • Quick links in a rail — use LinkList

What an agent reads

import { ListView } from "agentic-ds-kit";
must
  • The list has an accessible name from label
  • selection=none uses role=list and role=listitem; selection=single|multiple uses role=listbox and role=option
  • selection=multiple sets aria-multiselectable and composes kit Checkbox
  • Selected rows set aria-selected; disabled rows set aria-disabled and are not selectable or opened
  • interaction=drill makes the row body a button and exposes a trailing chevron; Enter opens, Space selects when selection is on
  • Grouped rows sit in role=group labelled by the header; collapsible headers are buttons with aria-expanded
  • When items is empty, kit Empty is rendered (title required) and the list keeps its accessible name
  • Keyboard: Up/Down move among visible rows and collapsible headers; Home/End; Space/Enter activate; trailing actions and checkboxes are not in the tab order, except in a row with a toggle: while it is the focused row, Tab moves to its Switch and actions, then out of the list
  • truncate clips visually only: the row's accessible name and the title attribute keep the full primary and secondary text
  • dot is aria-hidden and its tone (Note, Good, Warning, Problem, Info) joins the row name; meta is part of the row name
  • priority bars are aria-hidden; the priority word is visible at the start of the secondary line and in the row name
  • A row action with actionLabel is named by it (aria-labelledby a hidden span); without it the button's name is its visible label. actionLabel starts with the visible label so speech input still matches
  • value is part of the row name, after the secondary line; a group total is part of the group's name
  • A selected row shows the fill and a heavier name (flush adds a 2px brand edge), and still sets aria-selected; focus keeps the outline ring
  • metaTone and iconTone danger are colour only; meta text and the row text must say the problem
  • valueIcon is aria-hidden; note is part of the row name, after the secondary line, and noteTone is colour only
  • Hover wash: the fill is one decorative layer (aria-hidden) that glides to the row under the pointer or with keyboard focus on hover and arrow keys (clip-path only, --motion-expand-*); it lands in place on first show, after the pointer leaves and on resize or scroll, and jumps with no slide under prefers-reduced-motion. Roles, aria-selected and focus order are unchanged and the focus ring stays on the row. Rows sink a little on press (transform only). No motion under prefers-reduced-motion
defaults
  • size md
  • selection none
  • interaction none
  • collapsibleGroups false
  • truncate none
  • flush false
  • sort none
stops if
  • Do not use Table or DataTable for a record list without comparable columns
  • Do not use TreeView — that is a nested hierarchy, more than one level
  • Do not use the list-detail pattern for the list itself; put detail beside the list
  • Do not add an in-list detail slot under the selected row
  • Do not add nested children, path, step-in, or expand-under-row
  • Do not add drag, reorder, or onItemsChange
  • Do not add Density or Material Symbols
  • Do not use LinkList for record rows — LinkList is quick links
  • Do not invent a local blank slate — empty items render kit Empty
  • Do not assemble rows from local Cards + Avatars + Buttons; this is the piece
  • Do not use SideNav or DocsNav for a record list
  • Do not use Timeline for a record list
  • Do not use Card for picking records in a list
  • Do not use ListView for usage against a plan limit — use UsageList
  • Do not use more than two inline row actions — overflow is kit DropdownMenu
  • Do not place appearance=solid mode=primary Button on a row
  • Do not use raw hex or primitive --color-* ramps
  • Do not use dot as the only sign of a status; say it in primary or secondary
  • Do not write the priority word in secondary; the kit adds High, Medium or Low
  • Do not put an amount in meta or badge; use value
  • Do not use metaTone or iconTone danger as the only sign of a problem; the words must say it
  • Do not use valueIcon without value, or as the only way to tell values apart; the value words must say it
  • Do not use note for a time or a count at the row end (that is meta), or noteTone as the only sign; the note words must say it
  • Do not use metaHint for text the row does not already sum up in meta, or live for anything but a status that is happening now
  • Do not use toggle for anything but an instant on/off of that row; it is a kit Switch, not a selection
  • Do not change metaKey on every tick; key the kind of meta, not its text

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.

Props

NameTypeRequiredDefaultNotes
itemsarrayYes—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.
labelstringYes—Accessible name for the list
sizexs | sm | md | lgNomdxs 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.
selectionnone | single | multipleNononemultiple composes kit Checkbox
selectedstring[]No—controlled item ids. Single keeps 0 or 1 id. Ignored when selection is none.
defaultSelectedstring[]No—uncontrolled initial item ids
onSelectedChangefunctionNo—(selected: string[]) => void
interactionnone | drillNononedrill 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.
onOpenfunctionNo—(id: string) => void. Used when interaction is drill.
onActionfunctionNo—(itemId: string, actionId: string) => void
onTogglefunctionNo—(itemId, checked) => void. A row's toggle Switch changed.
groupsarrayNo—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.
collapsibleGroupsbooleanNofalseWhen true, group headers toggle their rows. Expanded by default.
truncatenone | secondary | bothNononeClip 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.
flushbooleanNofalseRows 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.
sortnone | priorityNononepriority orders rows high, medium, low, then rows without priority, within each group. Input order is kept within a level.
emptyobjectNo—When items is [], ListView renders kit Empty. title is required.
  • Component
    →

    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.

  • Component
    →

    DataTable

    Framed dataset with search, filters, column settings, and a caption title.

  • Component
    →

    TreeView

    Nested hierarchy people open and close level by level to browse, pick, or check items.

  • Pattern
    →

    List detail

    A list of invoices beside the one you opened.