Skip to content
Eskais UI

Guides

Keyboard and long lists

Shortcuts, keyboard navigation for lists and tables, and virtualization that keeps both working with thousands of rows.

Shortcuts

useShortcut(keys, handler, options) registers a key while the component is mounted, in UI SDK's shared shortcuts. Keys are +-joined (mod+k is ⌘K on Apple platforms and Ctrl+K elsewhere); a space makes a two-step sequence (g i). Plain keys never fire while someone types in an input, textarea or contenteditable, nor during IME composition. A modal pauses the page's shortcuts.

import { ShortcutScope, useShortcut } from "@/components/ui/shortcuts"import { ShortcutsDialog } from "@/components/ui/shortcuts-dialog"
function Inspector({ item, onClose }) {  useShortcut("escape", onClose, { description: "Close" })  return (    <ShortcutScope name="inspector" label="Item detail" active>      <Button shortcut="u" onClick={() => markRead(item)}>Mark read</Button>      <Button shortcut="p" onClick={() => pin(item)}>Pin</Button>    </ShortcutScope>  )}
useShortcut("g i", goToInbox, { description: "Go to inbox" })<ShortcutsDialog /> // once, anywhere: "?" lists what can run where focus is
  • ShortcutScope name label active limits the shortcuts registered inside it: to a region while focus is in it (active="focus", the default), or to an open panel (active). Inside a dialog they belong to that dialog.
  • Button shortcut="u" and DropdownMenuItem shortcut bind the key in the current scope, show it with Kbd and set aria-keyshortcuts. ShortcutHint keys draws keys anywhere else.
  • ShortcutsDialog opens on ? and lists every shortcut with a description that can run where the person is, grouped by scope.
  • Shortcuts are an accelerator for people. Agents gain nothing new: they already press the same buttons and menu items by name (see Agents).

Keyboard map for lists and tables

List (link or button rows), the AgentTaskBoard backlog and table, and DataTable give their rows one tab stop with UI SDK's roving focus. A selectable List is a UI SDK Listbox, which moves with its own arrows; j, k and the page keys map onto them.

KeyDoes
↓ or jNext row
↑ or kPrevious row
Home / EndFirst and last row, rendered or not
PageDown / PageUpA screen of rows down or up
EnterOpens the row: its link or button, or the table's onRowOpen
Space or xToggles the row's selection, where the list or table has one
TabLeaves the rows; coming back lands on the row focused last

The row that keys move to scrolls into view with the least scrolling. Keys typed in a control inside a row (a rename field, a menu) stay with that control. The rows keep the semantics of the list or table they belong to: no grid role is added.

<List  aria-label="Inbox"  items={messages}  getItemId={(message) => message.id}  itemText={(message) => message.subject}  renderItem={(message) => (    <ListItem id={message.id} title={message.subject} onSelect={() => open(message.id)} />  )}  checkedIds={checked}  onCheckedIdsChange={setChecked}/>
<DataTable  label="Invoices"  rows={invoices}  columns={columns}  getRowId={(invoice) => invoice.id}  selectable  onRowOpen={(invoice) => open(invoice.id)}  className="max-h-96"/>

Table cells

With navigation="cells", a DataTable moves by cell, as a spreadsheet does, on UI SDK's grid focus: the table takes the grid role and its cells one tab stop. A move renders only the cell left and the cell reached, and a row a virtualized table hasn't rendered is scrolled in first.

KeyDoes
← / →Previous and next cell in the row, following the text direction
↑ / ↓The same column in the row above or below
Home / EndFirst and last cell of the row
Ctrl or ⌘ + Home / EndFirst and last cell of the table
PageUp / PageDownTen rows up or down
SpaceToggles the row's selection, where the table has one
EnterThe table's onRowOpen

Board

A Board's cards are one tab stop, as on Linear: the AgentTaskBoard's cards take part through TaskCard, and a card of your own through <BoardCard id render={<Button …/>} /> on its primary control. Tab from the focused card reaches that card's own controls (links, chips, approve and reject), then leaves the board; the other cards' controls are out of the tab order until their card is focused. A move renders two cards.

KeyDoes
↓ or j / ↑ or kNext and previous card in the column
← / →The next column, at the same row or its last card
Home / EndFirst and last card of the column
Ctrl or ⌘ + Home / EndFirst and last card of the board
EnterOpens the card

Agents don't use these keys: they select and act on cards and rows through the board's and the table's own actions, whether or not the card or row has focus.

Virtualization

List with items and renderItem, and DataTable, render only the rows in view past 200 rows (virtualize="auto"; true or false to force it, estimateSize for the row height before it is measured; the first row measured sets it for the rest). It uses UI SDK's virtualizer and renders again only when the rows in view change, not on every scroll.

  • They scroll with their nearest scrolling ancestor, or the window when there is none. Give a list a bounded height (a flex child with min-h-0 and overflow-auto, or a max-h-*).
  • Rows stay in document flow: gaps take the place of the rows between, so a table keeps tbody > tr and a list ul > li. List rows carry aria-setsize and aria-posinset; table rows aria-rowindex under the table's aria-rowcount.
  • Every row is reachable: Home, End and the page keys scroll a row in before focus moves, and the focused row stays rendered while you scroll away. Agents' select and setSelection take any row's id.
  • Find in page reaches rows that aren't rendered: their text sits in hidden="until-found" elements, and finding one scrolls the real row in. Browsers without until-found find only the rendered rows.
  • Card lists and grouped lists don't virtualize: render fewer cards, or page them.
  • CommitHistory and GitTree share their rows through the trail-rows item: useTrailRows is useVirtualRows by default, and with findable puts rows on UI SDK's virtualizer so find in page reaches rows that aren't rendered.