Record List

View as Markdown

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

Todo4
Priority: Urgent
Status: Todo
ENG-144Invoice PDF cuts off long company namesReported by three customers this week
Labels: Bug
Impact: 3 of 3
Due: Dec 2
Assignee: Grace Hopper
Priority: High
Status: Todo
ENG-139Keyboard shortcuts for triage
Labels: Feature
Impact: 2 of 3
Due: Dec 11
Assignee: Grace Hopper
Priority: Medium
Status: Todo
ENG-131Empty states for saved views
Labels: Design
Impact: 1 of 3
Due: empty
Assignee: Ada Lovelace
Priority: Low
Status: Todo
ENG-128Notifications arrive twice on mobile
Labels: Bug
Impact: 2 of 3
Due: empty
Assignee: No assignee
In Progress3
Priority: Urgent
Status: In Progress
ENG-142Sign-in link expires before the email arrives
Labels: Bug
Impact: 3 of 3
Due: Dec 4
Assignee: Ada Lovelace
Priority: High
Status: In Progress
ENG-140SAML sign-in for the admin console
Labels: Feature
Impact: 3 of 3
Due: Dec 18
Assignee: Alan Turing
Priority: Medium
Status: In Progress
ENG-135Draft release notes for 2.4
Labels: empty
Impact: empty
Due: Dec 6
Assignee: Scout
In Review3
Priority: High
Status: In Review
ENG-137Export drops the last row of a filtered view
Labels: Bug
Impact: 3 of 3
Due: Dec 3
Assignee: Alan Turing
Priority: Medium
Status: In Review
ENG-126Bulk move issues between teams
Labels: Feature
Impact: 2 of 3
Due: Dec 9
Assignee: Grace Hopper
Priority: Medium
Status: In Review
ENG-133Triage suggestions for new bug reports
Labels: Feature
Impact: 2 of 3
Due: Dec 10
Assignee: Scout
Done2
Priority: High
Status: Done
ENG-121Webhook retries with backoff
Labels: Feature
Impact: 1 of 3
Due: Nov 27
Assignee: Alan Turing
Priority: Low
Status: Done
ENG-118Dark mode contrast on badges
Labels: Design
Impact: 1 of 3
Due: Nov 24
Assignee: Ada Lovelace
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

When to use

Rows of records, grouped and sorted, that you edit in place. Use Data Grid instead when the rows have many columns to compare.

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 { RecordList } from "./ui/uicontext/components/RecordList.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>,) =>	RecordList(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.

Priority: High
ENG-139Keyboard shortcuts for triage
Estimate: 5
Assignee: Grace Hopper
Priority: Medium
ENG-131Empty states for saved views
Estimate: 3
Assignee: Ada Lovelace
Priority: Low
ENG-128Notifications arrive twice on mobile
Estimate: No estimate
Assignee: No assignee
Priority: Urgent
ENG-144Invoice PDF cuts off long company namesReported by three customers this week
Estimate: 2
Assignee: Grace Hopper

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

RecordList 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
columnsRecordListColumn[]—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

RecordList 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 RecordList
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)

Keyboard and accessibility

KeysDoes
Left arrow Right arrowMove between a row’s cells; on a group, close or open it
Home EndGo to the row’s first or last cell
Pageup PagedownMove ten rows
Alt Up arrow Alt Down arrowMove the row in a list you can reorder
J Down arrowNext record
K Up arrowPrevious record
Shift J Shift KExtend the selection
XSelect or unselect
SpacePeek at the record; Escape closes it
EnterOpen the record
EscapeClear the selection
S P AOpen the picker for a field the app gives a shortcut, on the focused or selected records

On a Mac, Ctrl is ⌘ and Alt is ⌥. Left and Right trade places in right-to-left text.

  • 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.

Installation

pnpm dlx shadcn@latest add checkfu/uicontext/record-list

Source