List

Rows of records, grouped and sorted, that you edit in place.

Todo4
ENG-144Invoice PDF cuts off long company namesReported by three customers this week
Bug
★★★
Dec 2
GH
ENG-139Keyboard shortcuts for triage
Feature
★★★
Dec 11
GH
ENG-131Empty states for saved views
Design
★★★
AL
ENG-128Notifications arrive twice on mobile
Bug
★★★
In Progress3
ENG-142Sign-in link expires before the email arrives
Bug
★★★
Dec 4
AL
ENG-140SAML sign-in for the admin console
Feature
★★★
Dec 18
AT
ENG-135Draft release notes for 2.4
★★★
Dec 6
In Review3
ENG-137Export drops the last row of a filtered view
Bug
★★★
Dec 3
AT
ENG-126Bulk move issues between teams
Feature
★★★
Dec 9
GH
ENG-133Triage suggestions for new bug reports
Feature
★★★
Dec 10
Done2
ENG-121Webhook retries with backoff
Feature
★★★
Nov 27
AT
ENG-118Dark mode contrast on badges
Design
★★★
Nov 24
AL
JDown arrow
Next record
KUp arrow
Previous record
Shift JShift K
Extend the selection
X
Select or unselect
Space
Peek at the record; Escape closes it
Return
Open the record
S
Change Status on the focused or selected records
P
Change Priority on the focused or selected records
A
Change Assignee on the focused or selected records
Escape
Clear the selection

Installation

pnpm dlx shadcn@latest add checkfu/uicontext/list

Usage

import type { Outcome } from "./ui/uicontext/components/domain/Outcome.ts"import { type Item, type Property, Value } from "./ui/uicontext/components/domain/Record.ts"import { List } from "./ui/uicontext/components/kit/List.ts"
const Message = UiSchema.TaggedEnum({	RequestedEditTask: { request: Schema.String, item: Schema.String, key: Schema.String, value: Value },	OpenedTask: { id: Schema.String },})export const TaskList = (	h: Html.H<typeof Message.Type>,	tasks: ReadonlyArray<Item>,	fields: ReadonlyArray<Property>,	outcomes: ReadonlyArray<Outcome>,) =>	List(h, {		props: {			label: "Tasks",			records: tasks,			fields,			view: { groupBy: "status" },			columns: [{ key: "status", at: "start", compact: true }, { key: "assignee", compact: true }],			outcomes,		},		onEmit: {			RequestedEdit: (edit) => Message.RequestedEditTask(edit),			RequestedOpen: ({ item }) => Message.OpenedTask({ id: item }),			RequestedView: () => undefined,			RequestedAction: () => undefined,			RequestedReorder: () => undefined,			RequestedCreate: () => undefined,			Selected: () => undefined,		},	})

Examples

Ordered by hand

A flat list people put in order. Drag a row, or press Alt+Up and Alt+Down on it.

ENG-139Keyboard shortcuts for triage
5
GH
ENG-131Empty states for saved views
3
AL
ENG-128Notifications arrive twice on mobile
ENG-144Invoice PDF cuts off long company namesReported by three customers this week
2
GH

Empty

What a list says before it has records, with a button for the first one.

No issues yet

Issues for the mobile app show up here.

API reference

Props

List props
NameTypeDefaultDescription
labelrequiredstring—The list's accessible name: "Issues"
agentIdstringlist:<label>This list's id for agents, unique on the page; list:<label> by default
recordsrequiredItem[]—The records to show, in the order the app gives them
fieldsrequiredProperty[]—The fields the records share: their kinds, choices and formats
viewViewInput—How the records show: its filter, sort, groupBy, hidden and order
columnsListColumn[]—Where each shown field sits in a row; every shown field, after the title, by default
shortcutsFieldShortcut[]—Single keys that open a field's picker on the focused or selected rows: { key: "s", field: "status" }
selectablebooleantrueShows a checkbox per row and the action bar; true by default
actionsItemAction[]—What the action bar offers for the selected rows
reorderableboolean—Rows can be moved with Alt+Arrow keys or dragged, for a manually ordered list
createstring—Names a group header's + button ("New issue"), which emits RequestedCreate with the group; absent hides it
loadingboolean—Show placeholder rows while the records load
empty{ title, hint, create }—The empty state; create adds a button that emits RequestedCreate
outcomesOutcome[]—The app's answers to edit requests
noticestring | null—A sentence about the last bulk action: "2 issues couldn't be archived: they're locked"
rowHeightnumber40A row's height in pixels until measured; 40 by default
localestring—For Intl formatting and sorting; the browser's language by default
freshstring[]—Records the app just added, tinted until it takes them off the list

Events

List events
EventPayloadDescription
RequestedEdit{ request: string; item: string; key: string; value: Value }A value the person changed; answer through outcomes with the same request
RequestedOpen{ item: string }Open the record's page
RequestedCreate{ group?: string; title?: string; values?: Record<string, Value> }A new record, in the group it was added from ("" for the empty group)
RequestedAction{ action: string; items: string[] }One of the view's actions, on these records
RequestedReorder{ item: string; before: string | null }Move item before before, or last when it's null
RequestedView{ view: View }The person changed how the view shows records (its sort, grouping, widths); pass it back as view
Selected{ items: string[] }The selection changed

Agent actions

What agents can do with List
ActionDescription
CommittedEditSet one field of one row. value: an option value (see the field's choices), a list of them, text, a number, an ISO date, true/false, or null to clear
RequestedSelectionSelect rows by id, replacing the selection ([] clears it)
ClickedActionRun one of the list's actions on the selected rows; destructive ones name the selection as the target
ActivatedRowOpen a row, as Enter on it does
ClickedPeekPeek at a row: its fields in a side sheet, without leaving the list
ToggledGroupCollapse or expand a group by its value
MovedRowMove a row before another (or to the end with before: null)

Accessibility

  • A tree grid: arrows move between rows and cells, Enter edits or opens, Space or X selects, Shift extends the selection, Mod+A selects all.
  • A locked cell, a refused edit or a note on a value shows its reason when the cell has focus or is tapped, and is read as the cell's description.

Source