Skip to content
Eskais UI

Guides

Row actions

Buttons on a list row, like Open, Copy and Start, that keyboards and agents reach without selecting the row or changing a MasterDetail's detail.

Environments

3 running
Running
http://localhost:5173
Running
http://localhost:5174
Stopped
http://localhost:5175
Running
http://localhost:5176
Stopped
http://localhost:5177
No environment open

A grid, not a listbox

A listbox option can't hold buttons: screen readers flatten it to its text, and its keys belong to the list. So List rowActions turns the list into an APG layout grid. Each row is a primary cell, the row's own link or button that selects or opens it, and one cell per action. The grid is still one tab stop, and a row's actions are a key away instead of a Tab each.

KeyWhat it does
Up, Down, j, kThe row above or below, in the same column (its last cell when it has fewer).
Left, RightThe previous or next cell of the row, following the text direction.
Home, EndThe row's primary cell or its last action; with Ctrl or ⌘, the grid's first or last cell.
Page Up, Page DownAbout a screen of rows.
Enter, SpacePress the focused cell: the row's link or button, or the action.
TabLeave the grid; Tab back returns to the cell focused last.
  • Selectable (value, onValueChange), rows carry aria-selected, and an arrow onto a primary cell or a press on it selects, as in a listbox. Moving through action cells, or pressing one, never does.
  • In a MasterDetail, the row's primary cell opens it, andfollowFocus follows the primary cells only: an action on another row leaves the detail where it is.
  • On a mouse or trackpad the actions show while the row is hovered, holds focus or is selected; rowActionsVisibility="always" keeps them shown. A touch screen always shows them, and each button's hit area reaches 44px.
  • An action with disabled stays focusable and says why in its tooltip (a string); an action with href is a link, for navigation only.
environments.tsx
<MasterDetail  label="Environments"  followFocus  renderList={(state) => (    <List      aria-label="Worktrees"      rowActions={(id) => {        const env = byId.get(id)        return [          { id: "open", label: "Open URL", icon: ExternalLinkIcon, href: env.url, newTab: true },          { id: "copy", label: "Copy URL", icon: CopyIcon, onAction: () => copy(env.url) },          env.running            ? { id: "stop", label: "Stop", icon: SquareIcon, tone: "destructive",                confirm: `Stops ${env.name}`, onAction: () => stop(env.id) }            : { id: "start", label: "Start", icon: PlayIcon, onAction: () => start(env.id) },        ]      }}    >      {envs.map((env) => (        <ListItem key={env.id} {...state.itemProps(env.id)} title={env.name} subtitle={env.url} />      ))}    </List>  )}  renderDetail={(id) => ({ title: byId.get(id).name, content: <EnvironmentDetail id={id} /> })}/>

ListRowAction

FieldWhat it does
idThe same on every row that offers the action; agents run it by its label and the row's id.
labelNames the button, its tooltip with an icon, and the action for agents.
iconA lucide icon: the button shows only the icon.
onAction(details)Runs on a press and on an agent's run; details.cancel() refuses it.
href, newTabMakes it a link, like opening the row's URL.
disabledtrue, or why it can't run on this row now.
confirmThe data-agent-confirm sentence: an agent asks a person first. Use it for anything destructive.
tone"destructive" colours the button.

rowActionLabels renames the buttons (button(action, title)) and the actions agents see (group(action)), for instance when two lists on a page share an action.

Agents

Agents see one component per action, named by its label, whose run(id) takes the row's id and lists the rows that offer it, rendered or not. The rows' own buttons stay out of the snapshot, so a long list doesn't fill it. A row that doesn't offer the action, a disabled one, or a run the app cancels fails the step with why, and a confirm action waits for the person through your allow.

agent.ts
await agent.act({ steps: [{ ref: "Copy URL", action: "run", args: ["row-actions"] }] })// Stop carries data-agent-confirm: allow asks the person first.await agent.act({ steps: [{ ref: "Stop", action: "run", args: ["main"] }] })