# List row

The one row anatomy: navigation, chats, palette results, files and tray pickers.

Live variants: https://design.arcadia.is/components/list-row

```tsx
import {
  ListRow, ListRows, RowSectionLabel, ListRowEdit, textForms, nameForms,
  headForms, sentenceForms, asideForms,
} from "@arcadia/ui";
```

## When to use

- Sidebar navigation, chats, settings navigation, palette results or files in a changes card
- A list where one row is current, marked by its fill and ink
- Actions that share the end seat with the meta, revealed under the pointer

## When not to use

- A card's face: use `PriorityRow`
- A setting with its state and control: use `SettingsRow` in `SettingsGroup`
- Rows under a heading that folds them: use `Collapsible` with `variant=&quot;section&quot;`

## In context

In Act, the sidebar lists chats and projects as rows, one current, with a status when it has one and a time at the end.

Select a chat. The title leads, the preview sits below it, and the time keeps its own column.

```tsx
import { useState } from "react";
import { ListRow, ListRows, RowSectionLabel, StatusDot } from "@arcadia/ui";

function Sidebar() {
  const [active, setActive] = useState("settings");
  const chats = [
    { id: "settings", label: "Preferences dialog", status: "running", preview: "Checking keyboard focus", time: "now" },
    { id: "onboarding", label: "Onboarding flow", status: "attention", preview: "Waiting for your answer", time: "4m" },
    { id: "report", label: "Quarterly report", status: "unread", preview: "Draft ready for review", time: "13h" },
    { id: "upload", label: "Flaky upload test", status: "error", preview: "Staging check failed", time: "16h" },
    { id: "tokens", label: "Colour tokens", status: "idle", preview: "Compared light and dark", time: "2d" },
  ] as const;
  return (
    <nav {...sx("cmp-rows", cmp.rows)} aria-label="Chats in acme-web">
      <ListRows list>
        <RowSectionLabel>acme-web</RowSectionLabel>
        {chats.map((chat) => (
          <ListRow
            key={chat.id}
            leading={<StatusDot status={chat.status} />}
            label={chat.label}
            labelWraps
            sub={chat.preview}
            subWraps
            subTone={chat.status === "attention" ? "attention" : "quiet"}
            aside={<span {...stylex.props(s.clock)}>{chat.time}</span>}
            emphasis={chat.status === "unread"}
            active={active === chat.id}
            aria-current={active === chat.id ? "true" : undefined}
            onClick={() => setActive(chat.id)}
          />
        ))}
      </ListRows>
    </nav>
  );
}
```

## Usage

```tsx
import { ListRow } from "@arcadia/ui";

<ListRow
  leading="file-code"
  label="dialog.tsx"
  description="src/settings"
  meta="+9 −2"
  onClick={open}
/>
```

The one row anatomy: sidebar navigation, chats and projects, settings navigation, palette results, the files in a changes card and tray pickers. A 14px leading glyph slot, the label, an optional description, meta at the end, and actions revealed on hover in the seat they share with the meta. A hover fill comes in at once and trails off over `--duration-fast` when the pointer leaves; the current row's fill and a keyboard highlight change in one frame, both ways. A person row, and a tile in a list, take the current row's fill while pressed and hold still: nothing in a list moves on a layer of its own. Rows are 28px high. Within `ListRows`, one glyph keeps every label 30px in: 8px inset, 14px box, 8px gap. Without a glyph, labels start at 8px. `indent` steps the row and `RowSectionLabel` in 12px per level. The current row is marked by its fill and ink, never by the glyph.

`buttonProps` puts the product's own `data-*` marks on the row's own control, the one a press opens it from, whatever actions, menu or trail stand beside it; the row's other `data-*` go on the row once it holds other controls.

## Examples

### Folder selection

Give `ListRows list` a name and a controlled `listbox` value. Each `ListRow option` is a button with no nested controls. Use the arrow keys to move, then Enter or Space to select.

```tsx
import { useState } from "react";
import { ListRow, ListRows, ScrollArea } from "@arcadia/ui";

function FolderOptions() {
  const [folder, setFolder] = useState<string | null>(null);
  const [scrolled, setScrolled] = useState(false);
  return (
    <ListRows list aria-label="Folders" scrolled={scrolled} listbox={{ value: folder, firstOption: "documents", onValueChange: setFolder }}>
      <ScrollArea rootStyle={s.folderScroll} viewportProps={{ tabIndex: -1, onScroll: (e) => setScrolled(e.currentTarget.scrollTop > 0) }}>
        <ListRow option="documents" leading="folder" label="Documents" />
        <ListRow option="downloads" size="caption" tone="muted" leading="folder" label="Downloads" disabled />
        <ListRow option="projects" leading="folder" label="Projects" />
        <ListRow option="shared" leading="folder" label="Shared" />
      </ScrollArea>
    </ListRows>
  )
```

Use `size="caption"` with `tone="muted"` for secondary rows. Pass `scrolled` to draw a start edge whose colour you can set with `--rows-scroll-edge`.

### Palette rows

`emphasis` puts the label at text-1 beside a description, and `highlighted` is the keyboard highlight a list drives from elsewhere, such as a palette's search field. A description that says why a row can't act now ("Unavailable while running") carries state: `descriptionYields={false}` keeps its words while the label steps down, and it steps down itself only beside the label's shortest form.

```tsx
import { Ask, ListRow } from "@arcadia/ui";

<div {...sx("cmp-rows", cmp.rows)}>
  <ListRow
    leading="agent"
    label="Agent"
    description="Edit and run commands"
    emphasis
    highlighted
  />
  <ListRow
    leading="plan"
    label="Plan"
    description="Write a plan before changing anything"
    emphasis
  />
  <ListRow
    leading="ask"
    label="Ask"
    description="Answer questions without making edits"
    emphasis
  />
  <ListRow
    leading="compact"
    label="Compact context"
    description="Unavailable while running"
    descriptionYields={false}
    emphasis
    disabled
  />
</div>
```

### A line under the label

`sub` stands under a row's label for a result found by a line of its text: the row is two lines tall, its glyph and its `aside` on the label's line.

```tsx
import { ListRow, ListRows, Chip } from "@arcadia/ui";

<div {...sx("cmp-rows", cmp.rows)}>
  <ListRows>
    <ListRow leading="file-text" label="Launch week" sub="Leo: the final copy is in, so it ships Thursday" aside="2h" emphasis onClick={open} />
    <ListRow label="Retry uploads that time out" sub="Hana: the retries hide the real failure, and the test still passes" aside="Mon" emphasis onClick={open} />
    <ListRow leading="file-text" label="Payment retries" sub={<Chip hue="chart-2">Billing and invoices</Chip>} aside="Wed" emphasis onClick={open} />
  </ListRows>
</div>
```

Pass `subWraps` when the second line holds facts or status that must wrap whole rather than cut to one line. A node in `sub` gets a line as tall as it is and is never clipped: a label `Chip` keeps its box inside the row, where a string alone truncates with an ellipsis.

### A title of two lines

`labelLines` lets the label wrap to that many lines and truncates with an ellipsis, as `FadeText lines` does: a report's first line as its title, read without opening it, while the list keeps its rhythm.

```tsx
import { ListRow, ListRows, StatusDot } from "@arcadia/ui";

<div {...sx("cmp-rows", cmp.rows)}>
  <ListRows>
    <ListRow label="Exporting a board that holds more than two hundred cards stops at the first hundred, and the file it gives says nothing about the rest" labelLines={2}
      sub="Problem, from the app" aside="2h" emphasis onClick={open} light={<StatusDot status="unread" label="New" />} />
    <ListRow label="Let me pin a chat to the top of the sidebar" labelLines={2} sub="Idea, from an agent's tools" aside="Mon" onClick={open} light={<StatusDot />} />
  </ListRows>
</div>
```

### A control at the end of a lined row

A row that is not a control of its own may hold one visible action in `meta`. On a row with a `sub` the end seat is as tall as the label's line, so the action stands centred on the label's first line, however many lines the label and the sub take.

```tsx
import { Button, ListRow, ListRows } from "@arcadia/ui";

<div {...sx("cmp-rows", cmp.rows)}>
  <ListRows>
    <ListRow interactive={false} leading="ask" label="Sign in the support connector so Scout can answer the queue?" labelWraps emphasis
      sub="Scout in Messages" meta={<Button size="sm" variant="secondary" onClick={open}>Decide</Button>} metaYields={false} />
    <ListRow interactive={false} leading="admin" label="14 cases wait on you" emphasis
      sub="The first is 8 days overdue" meta={<Button size="sm" variant="secondary" onClick={open}>Open</Button>} metaYields={false} />
  </ListRows>
</div>
```

### A light, and answers

`light` hangs a row's waiting mark or unread dot in its margin; `choices` stands an ask's answers under its text, drawn by `Ask` as where the ask was posted.

```tsx
import { Ask, Avatar, ListRow, ListRows, StatusDot } from "@arcadia/ui";

<div {...sx("cmp-rows", cmp.rows)}>
  <ListRows>
    <ListRow
      leading={<Avatar kind="agent" avatar={ATLAS} name="Atlas" size="text" aria-hidden />} label="Migrate now, or after the backup?"
      labelWraps sub="Atlas waits for the backup at 18:00 if nobody answers" aside="2m" emphasis onClick={open}
      light={<StatusDot status="attention" />}
      choices={<Ask you choices={["Migrate now", "After the backup"]} askedOf="Ada Lovelace" />}
    />
    <ListRow
      leading={<Avatar name="Leo Marsh" size="text" aria-hidden />} label="Leo Marsh asks to write to you" labelWraps emphasis onClick={open}
      light={<StatusDot status="attention" />}
      choices={<Ask you choices={["Allow", "Ignore"]} askedOf="Ada Lovelace" />}
    />
    <ListRow leading="file-text" label="Launch week" sub="Leo: the final copy is in, so it ships Thursday" aside="2h" emphasis onClick={open}
      light={<StatusDot status="unread" label="Unread" />} />
    <ListRow leading="file-text" label="Retry uploads that time out" sub="Hana: the retries hide the real failure" aside="Mon" emphasis onClick={open}
      light={<StatusDot />} />
  </ListRows>
</div>
```

The light sits before the leading, on the label's line, and never takes a column or moves the row: while `light` is given the row holds that margin, so a read row passes the idle `StatusDot`, which draws nothing, and the list keeps one edge. The answers are buttons on a line of their own, from the label's edge, outside the row's control, so pressing the line around them still opens the row. They stand at rest and on touch alike. The question they answer takes `labelWraps`: it wraps whole, its time on its first line, and never steps down to a shorter form, which could turn a question into an order.

### A line above the label

`byline` stands who did it and for whom over the label, on a line of its own in Caption and the quietest ink: an ask's row names its asker there, and the question follows whole.

```tsx
import {
  ActorName, Ask, Avatar, ListRow, ListRows, StatusDot,
} from "@arcadia/ui";

<div {...sx("cmp-rows", cmp.rows)}>
  <ListRows>
    <ListRow
      leading={<Avatar kind="agent" avatar={ATLAS} name="Atlas" size="text" aria-hidden />}
      byline={<><ActorName actor={ATLAS_ACTOR} /> in Launch week</>}
      label="Did you pay the design retainer?" labelWraps aside="2m" emphasis onClick={open}
      light={<StatusDot status="attention" />}
      choices={<Ask you kind="task" offers={["Open the payment page for me"]} otherwise="Atlas marks it unpaid and tells the finance team" askedOf="Ada Lovelace" />}
    />
    <ListRow
      leading={<Avatar name="Leo Marsh" size="text" aria-hidden />}
      byline={<><ActorName actor={LEO_ACTOR} /> in Pricing page</>}
      label="Two notes on the plans" sub="Leo: both notes are in the draft" aside="1h" emphasis onClick={open}
      light={<StatusDot status="unread" label="Unread" />}
    />
  </ListRows>
</div>
```

The byline wraps rather than cutting, and the row grows to hold it. It is read before the label, so the words a reader hears begin with who is asking. Where the label wraps whole, the time stays on the label's first line, and the row's light keeps the margin at its top.

### A picture in the leading slot

A picture a line tall overhangs the glyph column and keeps the list's edge. A wider one, an agent with its person, widens the column, and its label and answers keep their room.

```tsx
import { Ask, Avatar, ListRow, ListRows, StatusDot } from "@arcadia/ui";

<div {...sx("cmp-rows", cmp.rows)}>
  <ListRows>
    <ListRow leading="file-text" label="Launch week" meta="2h" emphasis onClick={open} light={<StatusDot />} />
    <ListRow leading={<Avatar name="Leo Marsh" size="text" aria-hidden />} label="Leo Marsh" meta="1h" emphasis onClick={open} light={<StatusDot />} />
    <ListRow
      leading={<Avatar {...ATLAS_ACTOR} size={16} aria-hidden />} label="Did you pay the design retainer?" labelWraps meta="2m"
      emphasis onClick={open} light={<StatusDot status="attention" />}
      choices={<Ask you kind="task" offers={["Open the payment page for me"]} otherwise="Atlas marks it unpaid and tells the finance team" askedOf="Ada Lovelace" />}
    />
  </ListRows>
</div>
```

### A label beside a description

Neither loses a letter: the description gives way first, to its shorter forms (whole words, or a path's last whole folders, `asideForms`) and then whole; the label then ends on a whole word, or on a name boundary for a path or a single token (`textForms`, every label's default). The meta keeps its seat, and on hover the row's tooltip says both whole; narrow the room to see the folder step down and go, then the name step down.

```tsx
import { useState } from "react";
import { Slider, ListRow } from "@arcadia/ui";

function Beside() {
  const [w, setW] = useState(100);
  const files = [
    ["refunds.ts", "src/features/checkout/rounding/currencies/minor-units"],
    ["round-refunds-to-the-minor-unit-in-every-currency.test.ts", "test"],
    ["apply-quantity-discounts-to-the-cart-total.ts", "src/features/checkout/cart/pricing/discounts"],
  ] as const;
  return (
    <div {...stylex.props(s.frame)}>
      <div {...sx("cmp-rows", cmp.rows)} style={{ width: `${w}%` }}>
        {files.map(([name, folder]) => (
          <ListRow key={name} leading="file-code" label={name} description={folder} meta="+9 −2" onClick={open} />
        ))}
      </div>
      <Slider label="Room for the rows" min={30} value={w} onValueChange={setW} valueText={(value) => `${value}%`} rootStyle={cmp.scrubSlider} />
    </div>
  );
}
```

### A file row

The rule above, for a file: `forms` hands the label its shorter forms, here `nameForms`, which cuts a file name at `/`, `-`, `_`, `.`, a space or a camelCase hump, so it ends on a part of the name, never inside one. A `title` holds the full path, and the meta keeps its seat.

```tsx
import { useState } from "react";
import { Slider, ListRow, nameForms } from "@arcadia/ui";

function Files() {
  const [w, setW] = useState(100);
  const files = [
    ["src/features/checkout/rounding/currencies", "minorUnitRounding.ts"],
    ["test", "round-refunds-to-the-minor-unit-in-every-currency.test.ts"],
    ["src/features/checkout/cart/pricing", "apply_quantity_discounts.ts"],
  ] as const;
  return (
    <div {...stylex.props(s.frame)}>
      <div {...sx("cmp-rows", cmp.rows)} style={{ width: `${w}%` }}>
        {files.map(([dir, name]) => (
          <ListRow key={name} leading="file-code" label={name} forms={nameForms(name)} description={dir.slice(dir.lastIndexOf("/") + 1)}
            meta="+9 −2" title={`${dir}/${name}`} onClick={open} />
        ))}
      </div>
      <Slider label="Room for the file rows" min={30} value={w} onValueChange={setW} valueText={(value) => `${value}%`} rootStyle={cmp.scrubSlider} />
    </div>
  );
}
```

### A tag after the label

`tag` says where the row's item is filed, such as an agent's section, as a quiet outline tag right after the label, and gives way after the description, through `tagForms`. `headForms` drops a path's head one name at a time and dims the first word left, so the nearest name stays, and `forms={[]}` keeps a name whole: narrow the room to see the description go, then the path's head.

```tsx
import { useState } from "react";
import {
  Slider, Avatar, ListRow, characterFromId, headForms,
} from "@arcadia/ui";

function Tagged() {
  const [w, setW] = useState(100);
  const agents = [
    ["agt_hazel", "Hazel", ["Northwind", "Research", "Platform"], "Maps the codebase and who owns each part of it"],
    ["agt_bud", "Bud", ["Contoso"], "Writes the release notes and the upgrade guide"],
    ["agt_quill", "Quill", [], "Answers questions about the public API"],
  ] as const;
  return (
    <div {...stylex.props(s.frame)}>
      <div {...sx("cmp-rows", cmp.rows)} style={{ width: `${w}%` }}>
        {agents.map(([id, name, path, what]) => (
          <ListRow key={id} leading={<Avatar kind="agent" avatar={characterFromId(id)} name={name} size={16} aria-hidden />} label={name} forms={[]}
            {...(path.length ? { tag: path.join(" / "), tagForms: headForms(path, " / ") } : {})} description={what} emphasis onClick={open} />
        ))}
      </div>
      <Slider label="Room for the agent rows" min={30} value={w} onValueChange={setW} valueText={(value) => `${value}%`} rootStyle={cmp.scrubSlider} />
    </div>
  );
}
```

### Struck through

struck draws a line through the words of a label, whole: a task done in a plan. The row keeps its height and its glyph seat, and the line takes the label's ink.

```tsx
import { ListRow, ListRows, StatusDot } from "@arcadia/ui";

<ListRows>
  <ListRow interactive={false} leading={<StatusDot status="done" />} label="Read the current upload flow" struck />
  <ListRow interactive={false} leading={<StatusDot status="running" />} label="Pin the fixture server port" />
  <ListRow interactive={false} leading={<StatusDot status="done" />} label="Move the upload check to the staging runner" struck tone="muted" />
</ListRows>
```

### A meta that gives way

A row ranks its label over its meta: a label that fits keeps its time, one that would be cut takes the time's room, and one longer still ends on a whole word (whole sentences, then clauses, then words, `sentenceForms`). If even the shortest form is wider than the row, the browser draws an ellipsis. Hover or focus a long one: the time comes back and the label steps down to the words that fit beside it, and the layout check holds the label's `data-fit="primary"` and the meta's `data-fit="meta"`.

```tsx
import { ListRow, StatusDot } from "@arcadia/ui";

function Yields() {
  const chats = [
    ["Colour tokens", "2d"],
    ["Round refunds to the minor unit in every currency", "4m"],
    ["Quarterly report for the board, with the appendix", "13h"],
  ] as const;
  return (
    <div {...sx("cmp-rows", cmp.rows, cmp.rowsSidebar)} data-width="sidebar">
      {chats.map(([label, time]) => (
        <ListRow key={label} leading={<StatusDot />} label={label} meta={time} onClick={open} />
      ))}
    </div>
  );
}
```

### Actions in the end seat

A row's resting end (its meta, a state mark) and its actions share one seat: the actions are revealed in it as the meta fades, and a single-line label steps down to the words that fit beside them.

```tsx
import {
  Avatar, IconButton, ListRow, Menu, MenuContent, MenuItem, MenuTrigger,
  StatusDot,
} from "@arcadia/ui";

function Seat() {
  const chats = [
    ["Round refunds to the minor unit in every currency", "4m"],
    ["Colour tokens", "2d"],
  ] as const;
  return (
    <div {...sx("cmp-rows", cmp.rows, cmp.rowsSidebar)} data-width="sidebar">
      {chats.map(([label, time]) => (
        <ListRow key={label} leading={<StatusDot />} label={label} meta={time} onClick={open}
          actions={<>
            <IconButton icon="archive" label={`Archive ${label}`} size="xs" tone="muted" />
            <IconButton icon="more" label={`More for ${label}`} size="xs" tone="muted" />
          </>} />
      ))}
      <ListRow leading={<Avatar kind="agent" avatar={ATLAS} name="Atlas" size="text" aria-hidden />} label="Atlas" meta="1h" onClick={open}
        menu={(
          <Menu>
            <MenuTrigger render={<IconButton icon="more" label="More for Atlas" size="xs" tone="muted" />} />
            <MenuContent>
              <MenuItem>Open chat</MenuItem>
              <MenuItem>Pin to the top</MenuItem>
            </MenuContent>
          </Menu>
        )} />
    </div>
  );
}
```

Under the pointer the actions fade in and slide `--reveal-offset` into place over `--duration-fast` on `--ease-enter`, the `Reveal` pattern, while the meta fades on the same clock; keyboard focus in the row shows them at once. Where the actions need more room than the resting end, a single-line label narrows to clear them. A wrapping label uses the remaining width. In a row with a line under its label the end of the label's line, its `aside` and its `mark`, is that resting end and fades the same way. On a touch screen, where nothing hovers, they stand in the row as always, laid out beside the label in the meta's place.

On a phone, under 480 wide where nothing hovers, the seat has no room beside the text: the actions take a line under the label, from its edge, so the label and its time keep the first, and a row whose More is its `menu` keeps only that, the menu carrying the other actions.

### A state mark in the seat

`status` puts a row's state mark (a `StatusDot`, a `Spinner`, a `StatusDot` (`attention`)) in the trailing seat: the square of one `xs` action, its end on `--row-inset`, the mark at its centre. It never gives way to the label, and under the pointer the actions take the seat, the last of them on the mark's own square.

```tsx
import { IconButton, ListRow, StatusDot } from "@arcadia/ui";

function StatusSeat() {
  const agents = [
    { name: "Atlas", status: <StatusDot status="running" label="Working" /> },
    { name: "Juno", status: <StatusDot status="waiting" label="Needs you" /> },
    { name: "Vesta", status: <StatusDot status="done" label="Done" /> },
  ];
  return (
    <div {...sx("cmp-rows", cmp.rows, cmp.rowsSidebar)} data-width="sidebar">
      {agents.map(({ name, status }) => (
        <ListRow key={name} leading="agent" label={name} status={status} onClick={open}
          actions={<>
            <IconButton icon="model" label={`Change ${name}'s model`} size="xs" tone="muted" />
            <IconButton icon="more" label={`More for ${name}`} size="xs" tone="muted" />
          </>} />
      ))}
    </div>
  );
}
```

### A list that keeps its rhythm

`ListRows` with `list` is the list's element too: its rows stand 1px apart, a `RowGroup` stands twice `--rows-group-gap` after what is before it, and once inside another group. No row or section label carries a margin of its own.

```tsx
import { ListRow, ListRows, RowGroup, RowSectionLabel } from "@arcadia/ui";

<ListRows list>
  <ListRow leading="new-chat" label="New chat" onClick={open} />
  <ListRow leading="search" label="Search" onClick={open} />
  <RowGroup>
    <RowSectionLabel>acme-web</RowSectionLabel>
    <ListRow leading="chat" label="Colour tokens" meta="2d" onClick={open} />
    <RowGroup>
      <RowSectionLabel>Agents</RowSectionLabel>
      <ListRow leading="agent" label="Atlas" onClick={open} />
      <ListRow leading="agent" label="Juno" onClick={open} />
    </RowGroup>
  </RowGroup>
  <RowGroup>
    <RowSectionLabel>denar</RowSectionLabel>
    <ListRow leading="chat" label="Round refunds to the minor unit" meta="4m" onClick={open} />
  </RowGroup>
</ListRows>
```

### Rows hung on a column's edge

`hang` pulls the list out by `--row-inset` on both sides, so the rows' words stand on the edge of the text around them and only their fills reach past it.

```tsx
import { ListRow, ListRows } from "@arcadia/ui";

<div {...sx("cmp-hung", s.hungColumn)}>
  <p {...sx("cmp-hung-text", s.hungText)}>Threads</p>
  <ListRows list hang>
    <ListRow label="Release notes for the week" meta="2h" onClick={open} />
    <ListRow label="Colour tokens" meta="1d" onClick={open} />
  </ListRows>
</div>
```

### A control after the name

A `trail` control stands on the label's line, directly after the words and outside the row's own control: the row keeps its press, and the control is a stop of its own. `meta` stays past it at the row's end, and the row becomes a container, as it does with actions or choices.

```tsx
import { IconButton, ListRow } from "@arcadia/ui";

<div {...sx("cmp-rows", cmp.rows, cmp.rowsSidebar)} data-width="sidebar">
  <ListRow label="Status: open" meta="12" onClick={open}
    trail={<IconButton icon="x" label="Remove the open filter" size="sm" tone="muted" onClick={open} />} />
  <ListRow label="Owner: me" meta="4" onClick={open}
    trail={<IconButton icon="x" label="Remove the owner filter" size="sm" tone="muted" onClick={open} />} />
</div>
```

### Rows on the container's edge

`flush` takes the inset from both ends: the label starts, and the trailing seat ends, on the container's edges, not `--row-inset` in from them. The fill still spans the row. Default false.

```tsx
import { ListRow, ListRows } from "@arcadia/ui";

<div {...stylex.props(s.frame)}>
  {[false, true].map((flush) => (
    <div key={String(flush)} {...stylex.props(s.edge)}>
      <p {...stylex.props(s.edgeTag)}>{flush ? "flush" : "Default"}</p>
      <ListRows>
        <ListRow label="Move the upload test to the staging runner" meta="2m" flush={flush} onClick={open} />
        <ListRow label="Write the release notes" meta="1h" flush={flush} onClick={open} />
      </ListRows>
    </div>
  ))}
</div>
```

### A trailing seat on the end edge

`trailEnd` ends the trailing seat (`meta`, `status`, `actions`, `menu`) on the row's end edge and leaves the label its start inset. Default false.

```tsx
import { ListRow, ListRows, StatusDot } from "@arcadia/ui";

<div {...stylex.props(s.frame)}>
  {[false, true].map((trailEnd) => (
    <div key={String(trailEnd)} {...stylex.props(s.edge)}>
      <p {...stylex.props(s.edgeTag)}>{trailEnd ? "trailEnd" : "Default"}</p>
      <ListRows>
        <ListRow label="Move the upload test to the staging runner" meta="2m" trailEnd={trailEnd} onClick={open} />
        <ListRow label="Write the release notes" status={<StatusDot status="done" />} trailEnd={trailEnd} onClick={open} />
      </ListRows>
    </div>
  ))}
</div>
```

### A mark that comes in

`markOnHover` keeps a `mark` out of sight until the pointer is on the row or the keyboard is in it, in at once and out over `--duration-fast`, and standing always where nothing hovers. Its room is held, so nothing moves; the first row here is shown under the pointer.

```tsx
import { Icon, ListRow } from "@arcadia/ui";

<div {...sx("cmp-rows", cmp.rows, cmp.rowsSidebar)} data-width="sidebar">
  <ListRow leading="folder" label="acme-web" meta="2m" mark={<Icon name="chevron-right" />} markOnHover data-force="hover" onClick={open} />
  <ListRow leading="folder" label="denar" meta="5h" mark={<Icon name="chevron-right" />} markOnHover onClick={open} />
  <ListRow leading="folder" label="yours" meta="1d" mark={<Icon name="chevron-right" />} markOnHover onClick={open} />
</div>
```

### A leading glyph that gives way

`leadingOnHover` draws a second glyph on the leading spot under the pointer, on the row's keyboard focus and while it is a drop target: here a project's folder gives way to the caret that opens it. The rest glyph stays where nothing hovers.

```tsx
import { ListRow } from "@arcadia/ui";

<div {...sx("cmp-rows", cmp.rows, cmp.rowsSidebar)} data-width="sidebar">
  <ListRow leading="folder" leadingOnHover="chevron-right" label="acme-web" meta="2m" onClick={open} />
  <ListRow leading="folder" leadingOnHover="chevron-right" label="denar" meta="5h" data-force="hover" onClick={open} />
  <ListRow leading="folder" leadingOnHover="chevron-right" label="yours" meta="1d" onClick={open} />
</div>
```

### A row in flight, and the drop

`dragging` dims a row and takes the grabbing pointer; `dropTarget` gives the row under a drop the drop fill and a 1px inset ring, an outline of the system's ink under forced colours. Each sets a `data-` attribute a product can read.

```tsx
import { ListRow } from "@arcadia/ui";

<div {...sx("cmp-rows", cmp.rows, cmp.rowsSidebar)} data-width="sidebar">
  <ListRow leading="chat" label="Quarterly report" meta="13h" dragging onClick={open} />
  <ListRow leading="folder" label="acme-web" meta="2m" dropTarget onClick={open} />
  <ListRow leading="folder" label="denar" meta="5h" onClick={open} />
</div>
```

### Inline rename

Double-click to rename: `editing` turns the row into a static container for a `ListRowEdit`. Enter or blur commits; Esc cancels.

```tsx
import { useState } from "react";
import { ListRow, ListRowEdit, StatusDot } from "@arcadia/ui";

function Rename() {
  const [title, setTitle] = useState("Quarterly report");
  const [editing, setEditing] = useState(false);
  return (
    <div {...sx("cmp-rows", cmp.rows, cmp.rowsSidebar)} data-width="sidebar">
      <ListRow
        leading={<StatusDot />}
        editing={editing}
        onDoubleClick={() => setEditing(true)}
        label={editing
          ? (
            <ListRowEdit
              defaultValue={title}
              aria-label="Chat title"
              onCommit={(v) => { setTitle(v.trim() || title); setEditing(false); }}
              onCancel={() => setEditing(false)}
            />
          )
          : title}
      />
    </div>
  );
}
```

### You are here

The active row is a flat fill-3 with its label in text-1, no lift and no shadow, and hover is fill-5 and a keyboard highlight fill-4, so a hovered row never reads as selected. In a list with a `Glide`, the glide draws hover and highlight and the row draws only this.

```css
.sidebar .ui-row {
  --row-fill-active: var(--bg-selected); /* the default: --bg-pane on sidebar/inset, stepping up inside panes/cards */
}
```

### A quiet row, selected

A row keeps its `tone` when it is the current one: a tab only previewed stands on the selected ground with its label still quiet.

```tsx
import { ListRow } from "@arcadia/ui";

<div {...sx("cmp-rows", cmp.rows, cmp.rowsNarrow)}>
  <ListRow label="Explain the pricing module" onClick={() => {}} />
  <ListRow label="Round refunds" tone="muted" active aria-current="page" onClick={() => {}} />
  <ListRow label="Audit the API in parallel" onClick={() => {}} />
</div>
```

### People

`size="person"` is a row for someone you talk to: a 36px avatar in `leading`, the name over one `sub` line (52px, and 40px with no line, the name centred on the avatar), `aside` at the end of the name's line and `meta` in a seat at the row's end. A name that would be cut takes the `aside`'s room until hover or focus, though the current row, or one holding a dot or a `mark` (a wait's reset, which never yields), keeps it. Pressed, it takes the current row's fill (fill-3) and holds still; only its avatar's loops run on layers, clipped inside the avatar. A latest-message preview takes `subTone="quiet"`, the sidebar preview ink, which stays at least 4.5:1 on the sidebar at rest, under the pointer, selected and pressed.

```tsx
import { useState } from "react";
import { Avatar, ListRow, StatusDot, TextRoll } from "@arcadia/ui";

function People() {
  const [active, setActive] = useState("juniper");
  return (
    <nav {...sx("cmp-rows", cmp.rows, cmp.rowsSidebar)} data-width="sidebar" aria-label="Agents">
      <ListRow size="person" active={active === "juniper"} onClick={() => setActive("juniper")}
        leading={<Avatar kind="agent" avatar={JUNIPER} name="Juniper" size={36} state="working" aria-hidden />}
        label="Juniper" sub={<TextRoll text="Looking through files" />} />
      <ListRow size="person" active={active === "pebble"} onClick={() => setActive("pebble")}
        leading={<Avatar kind="agent" avatar={PEBBLE} name="Pebble" size={36} aria-hidden />}
        label="Pebble" sub="Merged and deployed. The docs are updated too." subTone="quiet" meta={<StatusDot status="unread" label="Finished while you were away" />} />
      <ListRow size="person" active={active === "atlas"} onClick={() => setActive("atlas")}
        leading={<Avatar kind="agent" avatar={ATLAS} name="Atlas" size={36} state="waiting" aria-hidden />}
        label="Atlas" sub="Waiting for you" subTone="attention" aside="12:01 AM" meta={<StatusDot status="attention" label={null} />} />
      <ListRow size="person" active={active === "quill"} onClick={() => setActive("quill")}
        leading={<Avatar kind="agent" avatar={QUILL} name="Quill" size={36} aria-hidden />} label="Quill" />
    </nav>
  );
}
```

### Text in a box of your own

The label, a description and a string `meta` sit on their capitals, so their middles meet the row's. Text you draw in a box of your own, such as a time in a fixed-width column, takes the trim the row hands down, `--caps-trim` and `--caps-pad`, or it sits a device pixel under the label beside it.

```css
/* a time in its own right-aligned box: on its capitals, beside the label on its own */
.sidebar-time {
  display: block; min-width: var(--timestamp-box); text-align: end;
  text-box: var(--caps-trim); padding-block: var(--caps-pad);
}
```

### As wide as its words, within its column

Use `rootStyle` to cap the row at the smaller of the bubble measure and the available width. A reply's quote then fits its column.

```tsx
import { ListRow } from "@arcadia/ui";

<div {...sx("list-row-phone", s.phone)}>
  <ListRow tone="muted" leading="reply" label="Ada Lovelace" description={QUOTED} onClick={() => {}} rootStyle={s.quote} />
</div>
```

### A corner of its own

`--row-start-start-radius`, `--row-start-end-radius`, `--row-end-start-radius` and `--row-end-end-radius` set one corner of the fill, its ring and its press, each `--row-radius` by default. A tab on an island's corner takes the island's radius there and keeps its own at the others, with no wrapper to clip it.

```tsx
import { useState } from "react";
import { ListRow, ListRows } from "@arcadia/ui";

function IslandTabs() {
  const [on, setOn] = useState("Chat");
  return (
    <div {...stylex.props(s.island)}>
      <ListRows>
        <div {...stylex.props(s.tabs)}>
          {(["Chat", "Files", "Browser"] as const).map((name, i) => (
            <ListRow key={name} label={name} active={on === name} onClick={() => setOn(name)} rootStyle={[s.tab, i === 0 && s.firstTab]} />
          ))}
        </div>
      </ListRows>
    </div>
  );
}
```

### Loading

A `Skeleton` in the label keeps the row's height while its data arrives.

```tsx
import { ListRow, Skeleton } from "@arcadia/ui";

<div {...sx("cmp-rows", cmp.rows, cmp.rowsSidebar)} data-width="sidebar" aria-busy="true">
  {(["72%", "48%", "60%"] as const).map((w) => (
    <ListRow
      key={w}
      interactive={false}
      label={<Skeleton width={w} />}
    />
  ))}
</div>
```

## Matrix

Size and state

Rows: Medium, Caption, Person. Columns: Rest, Hover, Focus, Highlighted, Active, Disabled.

## Customising

`rootStyle` takes where the row sits and these knobs, each a token of its kind. The states read their own values (the current row is text-1 over `--row-fill-active`, a disabled one text-4), so a colour you set never drops a state. `--row-gap` sets the space between a row's parts, and a list's label column follows it.

- `--row-radius` (`Ref<Radius> | Derived`, default `var(--radius-control)`): Corner radius of the fill.
- `--row-start-start-radius` (`Ref<Radius> | Derived`, default `var(--row-radius)`): One corner of the fill, where it meets another frame's (a first tab on an island's corner). Default: `--row-radius`.
- `--row-start-end-radius` (`Ref<Radius> | Derived`, default `var(--row-radius)`): The block start, inline end corner. Default: `--row-radius`.
- `--row-end-start-radius` (`Ref<Radius> | Derived`, default `var(--row-radius)`): The block end, inline start corner. Default: `--row-radius`.
- `--row-end-end-radius` (`Ref<Radius> | Derived`, default `var(--row-radius)`): The block end, inline end corner. Default: `--row-radius`.
- `--row-fill` (`Paint`, default `transparent`): Fill at rest.
- `--row-fill-inset-start` (`Ref<Space> | Ref<Measure> | Derived`)
- `--row-fill-hover` (`Paint`, default `var(--_sidebar-row-hover, var(--fill-5))`): Fill under the pointer (and while the row's actions have a menu open).
- `--row-fill-highlight` (`Paint`, default `var(--fill-4)`): Fill of the keyboard highlight a list drives from elsewhere.
- `--row-fill-active` (`Paint`, default `var(--_sidebar-row-selected, var(--bg-selected))`): Fill of the current row.
- `--row-shadow` (`Ref<Shadow> | "none"`, default `none`): Shadow at rest.
- `--row-shadow-active` (`Ref<Shadow> | "none"`, default `none`): Shadow of the current row.
- `--row-fg` (`Paint`, default `var(--text-2)`): Label colour (the current row is text-1, a disabled one text-4).
- `--row-fg-hover` (`Paint`, default `var(--text-1)`): Label colour under the pointer and on keyboard focus. Default: the rest ink (`--row-fg`).
- `--row-icon` (`Paint`, default `var(--icon-2)`): Leading glyph colour (the current row is icon-1, a disabled one icon-4).
- `--row-icon-hover` (`Paint`, default `var(--row-icon)`): Leading glyph colour under the pointer and on keyboard focus. Default: the rest ink (`--row-icon`).
- `--row-description` (`Paint`, default `var(--text-3)`): Description colour.
- `--row-meta` (`Paint`, default `var(--text-3)`): Meta colour.
- `--row-gap` (`Ref<Space>`, default `var(--icon-gap)`): Space between the row's parts: its leading glyph, label, meta and actions; the label's column follows it. Default: `--icon-gap`.
- `--row-main-pad-block` (`Ref<Space> | Derived`)
- `--row-mark-gap` (`Ref<Space> | 0`, default `0`): Space after the mark's content (a highlight dot's breathing room). Default 0.
- `--row-cursor` (`"pointer" | "default"`, default `pointer`): `default` on options the keyboard leads (a command palette).
- `--glide-fill` (`Paint`, default `var(--fill-4)`): The Glide's fill on this row under the pointer.
- `--glide-fill-kbd` (`Paint`, default `var(--fill-3)`): The Glide's fill on this row under the keyboard.

## Accessibility

Without `trail`, actions or choices the row is one control: a `button`, or your element through `render`, such as a link. With any of them it becomes a container holding the control and those controls side by side, so no button nests inside another; Tab reaches the trail, the answers, then the actions, after the row. A light with a `label` is read as part of the row's name. Set `aria-current` yourself on the row for the current page. A truncated label or description is still read whole. Under forced colours, which drop every fill, the current row stands on the system's highlight, its words and glyph in the highlight's text.

Actions show while the row has keyboard focus, so Tab reaches them right after it; Shift+Tab from the row below skips them while they are hidden. A touch screen, where nothing hovers, keeps them in view in the meta's place. A row inside its own `ContextMenuTrigger` sets `touchActions="menu"` instead: there a long press opens the menu at the finger, the menu holds every action, and the meta keeps its seat. Lifting the finger after a long press never activates the row.

- Enter + Space: Activates the row
- Enter: Commits a rename
- Esc: Cancels a rename

## API reference

### ListRow

- `size` (`"md" | "caption" | "person"`, default `"md"`): `md`, a Body row; `caption`, a Caption row; `person`, a picture beside the name.
- `leading` (`IconName | ReactNode`): Leading glyph name or node. Wrap siblings in `ListRows` to share a column.
- `leadingOnHover` (`ReactNode`): Drawn in the leading slot in place of `leading` while the row is under the pointer, holds keyboard focus or is a drop target; it takes the pointer at once and gives it back over `--duration-fast`. Where nothing hovers the rest glyph stays.
- `indent` (`number`): Nesting levels (12px each). The whole row moves, not just its label.
- `label` (`ReactNode`): The label (or pass it as children). Text ends on a whole word; a Skeleton here keeps the row height.
- `labelId` (`string`)
- `option` (`string`)
- `forms` (`readonly (ReactNode | { cut: ReactNode })[]`): The label's shorter forms: beside a description or a tag its words step down, alone it fills the row (ARC-1000).
- `labelWraps` (`boolean`): The label wraps whole, never shortened: a question someone must answer.
- `labelLines` (`number`): The label wraps to this many lines at most, the last fading at its end (`FadeText lines`): a report's title.
- `description` (`ReactNode`): Text-3 after the label: it steps down, then goes, before the label loses a word; the hover says both whole.
- `descriptionForms` (`readonly (ReactNode | { cut: ReactNode })[]`, default `asideForms`): Its shorter forms.
- `descriptionYields` (`boolean`): `false`: it carries state ("Unavailable while running") and keeps its seat while the label steps down.
- `apart` (`number`): Beside a state description: its forms that tell it from its list's rows (`apartForms`).
- `tag` (`ReactNode`): A muted tag after the label (where it is filed): it gives way after the description, by `tagForms`.
- `tagForms` (`readonly (ReactNode | { head: ReactNode })[]`)
- `full` (`false`): `false`: the row's own Tooltip says the whole text.
- `sub` (`ReactNode`): One line under the label, text-3: the last thing said, or the line a result was found by; a `md` row grows.
- `subWraps` (`boolean`): `sub` wraps whole instead of cutting to one line: facts or status that cannot lose a word.
- `subTone` (`"neutral" | "quiet" | "attention"`, default `"neutral"`): `quiet` draws `sub` in the sidebar preview ink on a row drawn on the sidebar, still 4.5:1 there at rest, under the pointer, selected and pressed. `attention` draws it in the warning ink (they wait for you).
- `byline` (`ReactNode`): A line above the label: who did it and for whom (an `ActorName`), where it stands. Caption in `--text-3`, wrapping; the row grows to hold it, and a reader hears it before the label.
- `aside` (`ReactNode`): A `person` row's, or one's with `sub`: a time ending the label's line, yielding as a meta does.
- `meta` (`ReactNode`): End slot (a time, a shortcut Chip, diff stats), hidden while actions show under a pointer; never in the row's name: a shortcut (`Kbd`, a small Chip, `"⌘N"`) becomes its `aria-keyshortcuts`, anything else its description.
- `shortcut` (`string | readonly string[]`): Trailing Caption keyboard hint, in place of meta.
- `metaOnHover` (`boolean`): Quiet meta: hidden until hover or keyboard focus (a nav row's ⌘N badge).
- `metaYields` (`boolean`): The meta gives way to a label or description it would shorten until hover, focus or `highlighted` (default; `false` keeps its seat). Not with `sub`.
- `metaStays` (`boolean`): Keep `meta` visible beside `actions` on hover and keyboard focus (a row's state mark).
- `status` (`ReactNode`): A state mark (a `StatusDot`, a `Spinner`, a `StatusDot` (`attention`)) in place of `meta`, in the row's trailing seat: the square of one `xs` action, its end on `--row-inset`, the mark at its centre. It never yields to the label; under the pointer the `actions` take the seat, the last of them on the mark's square.
- `mark` (`ReactNode`): A mark that never yields (a highlight) after the label, at the row's end after a cut one; a `person` row's ends its name's line.
- `markOnHover` (`boolean`): The mark stands under the pointer and on the row's keyboard focus, in at once and out over `--duration-fast`, and always where nothing hovers (a fold's caret a quiet head reveals). It keeps its room, so nothing moves.
- `trail` (`ReactNode`): A control that stands on the label's line, directly after it and outside the row's own control (a fold's caret): the row keeps its press, and this control is a stop of its own; `meta` stays past it at the row's end. A `md` row.
- `actions` (`ReactNode`): Hover-revealed end actions (IconButton size="xs" tone="muted") in `meta`'s slot, three at most (`MAX_ROW_ACTIONS`; more fails in development): the rest, and a destructive one, go in the row's menu. In a tree or listbox: `aria-hidden`, keyboard commands on the row.
- `actionsOpen` (`boolean`): Keep actions and the hover fill while one's menu is open.
- `menu` (`ReactNode`): The row's menu, its More: in the end seat after `actions` at every width, and alone there on a phone, where the actions move into it and it must carry them.
- `touchActions` (`"shown" | "menu"`, default `"shown"`): On touch: `shown` in view; `menu`: in the row's long-press `ContextMenu`.
- `light` (`ReactNode`)
- `lightPlacement` (`"seat" | "gutter"`, default `"seat"`)
- `choices` (`ReactNode`): An ask's answers, on a line of their own under the text, outside the row's control: the `Ask` part, which says in every state what the ask says where it was posted (its otherwise line is the row's `sub`).
- `active` (`boolean`): Current item (route, open chat): fill + text-1. Set `aria-current` yourself where it applies.
- `highlighted` (`boolean`, default `false`): Keyboard highlight in a list driven from elsewhere (palette, tray with focus in a search box).
- `tone` (`"neutral" | "muted"`, default `"neutral"`): `muted`: text-3 rows ("More (4)", "No chats yet"). `neutral`: text-2.
- `emphasis` (`boolean`): Label at text-1 (tray and palette rows with a description).
- `regularLabel` (`boolean`, default `false`)
- `struck` (`boolean`, default `false`): The label struck through, whole: a task done.
- `editing` (`boolean`, default `false`): Inline rename: the row stops being a button so a `ListRowEdit` can sit in the label slot.
- `interactive` (`boolean`, default `true`): False renders a static row (a `div`, no hover fill): read-only lists, placeholders.
- `fillFrom` (`"row" | "label"`, default `"row"`): Where the hover, pressed, selected and focus fills start: `row` at the row's edge, its leading glyph inside; `label` at the label's edge, the leading glyph left outside it. A tree's child row, whose leading column carries the rail to its parent.
- `dropTarget` (`boolean`, default `false`): A drop target: the row takes the drop fill and an inset ring, an outline of the system's ink under forced colours.
- `dragging` (`boolean`, default `false`): The row being dragged: its ink dims and the pointer takes `grabbing`.
- `buttonProps` (`ButtonMarks`): The product's own marks on the row's own control, the button or link its `onClick` or `href` runs from, whatever actions, menu or trail it has: its `data-*` only. The row's other `data-*` go on the row once it holds other controls.
- `flush` (`boolean`, default `false`): No inset at either end: the row's label starts, and its trailing seat ends, on the container's edges instead of `--row-inset` in from them. The fill still spans the row.
- `trailEnd` (`boolean`, default `false`): The trailing seat (`meta`, `status`, `actions`, `menu`) ends on the row's end edge instead of `--row-inset` in from it; the label keeps its start inset.
- `rootStyle` (`ListRowStyle`): Typed StyleX override: where the row sits and its `--row-*` knobs.
- `disabled` (`boolean`, default `false`): Text-4, no hover fill, not clickable.
- `render` (`ReactElement | (props, state) => ReactElement`): Replace the rendered element, e.g. `render={<a href="/settings" />}`.

Rest props go to `<button>` props and `render`.

### ListRowEdit

- `onCommit` (`(value: string) => void`): Enter or blur: the trimmed-or-not value is the caller's call.
- `onCancel` (`() => void`): Escape: revert.
- `selectOnMount` (`boolean`, default `true`): Focus and select the whole value on mount.

Rest props go to `<input>` props.

### RowSectionLabel

- `indent` (`number`): Nesting levels, matching `ListRow indent`.
- `led` (`boolean`): Override whether the name clears the leading column. Defaults to the surrounding list's column.
- `rootStyle` (`RootStyle`): Typed StyleX override: where it sits, such as the space above a sub-group. Layout only.

Rest props go to `<div>` props.
