<!-- generated by scripts/gen-docs.mjs from docs/system/data-list.md. Edit the source and rerun. -->
# DataList

## Description
Lists the facts about one thing as label and value pairs, such as a fund's domicile and auditor or a booking's guest and room.

`import { DataList, DataListItem, DataListLabel, DataListValue } from "@/components/cobalt/ui/data-list"`, source `registry/cobalt/ui/data-list.tsx`, status `ready`.
Foundation: `hand-rolled`. Traps checked: `trap/empty-value`, `trap/numbers-shift`, `trap/table-divs`, `trap/text-measure`, `trap/list-dead-gap`, `trap/loading-layout-shift`.

`trap/empty-value` is answered by `missing(reason)`, which reads the reason through MissingValue, and by `none` for a value of nothing (Rules). `trap/numbers-shift` by tabular figures on every value (Tokens). `trap/table-divs` by the `dl`, `dt` and `dd` elements, the semantics a screen reader reads as pairs (ARIA). `trap/text-measure` by the 128px floor on the label and the value that drops to its own line (Limits). `trap/list-dead-gap` n/a: nothing in the list is clickable. `trap/loading-layout-shift` by `pending`, whose skeleton lines take each value's line height (States).

### Foundation
Not applicable: hand-rolled.

| Given by the foundation | Added by the team |
|---|---|
| Not applicable: hand-rolled, the HTML `dl` | Two orientations from one `orientation` prop that the parts read through a group; the horizontal label keeps 128px and the value drops to its own line, still at the end, when it cannot sit beside it; the value in tabular figures; a value the source did not give, `missing(reason)` from `registry/cobalt/lib/missing.ts`, reads its reason through MissingValue, "Not reported" or "Could not be read" (`registry/cobalt/ui/data-list.tsx:118`), and a value of nothing reads `none`, "None" by default, both in the label's colour; replaces the four hand-rolled `dl` copies in the scenes (`docs/research/2026-10-17-coverage.md`, section 1); `pending` on `DataList` for the first load, where the labels show and each value holds its line with a skeleton line of a steady width, never reading "None", with `aria-busy` |

## Examples
A fund's facts, each label at the start and its value at the end, formatted from the filing's numbers.

Real uses, 0 call sites (`rg -n "<DataList\b" app registry --glob '!registry/cobalt/ui/*'`): the part is new; the record, screener and filing-alerts scenes still hand-roll the same `dl`.

### Example files
| File | Covers | Caption |
|---|---|---|
| `docs/system/examples/data-list/default.tsx` | default | A fund's facts, each label at the start and its value at the end, with the figures formatted from the filing's raw numbers |
| Not applicable: default.tsx is horizontal, the default | orientation=horizontal | Horizontal, for a card or a side column, each pair on one line |
| `docs/system/examples/data-list/orientation-stacked.tsx` | orientation=stacked | Stacked in two columns, for a record page where values run long |
| `docs/system/examples/data-list/state-missing-value.tsx` | state:missing-value | A value the filing did not give says why, Not reported or Could not be read, so it does not look like it is still loading |
| `docs/system/examples/data-list/state-missing-value.tsx` | state:none | A fact the filing answers with nothing, Side pockets, reads None |
| `docs/system/examples/data-list/pending.tsx` | state:pending | Facts on their first load: the labels show at once and each value holds its line with a skeleton line |
| `docs/system/examples/data-list/in-card.tsx` | composition:Card | The facts in a card, where the first label lines up with the title |

Example: A fund's facts, each label at the start and its value at the end, with the figures formatted from the filing's raw numbers (`docs/system/examples/data-list/default.tsx`)

```tsx
import { DataList, DataListItem, DataListLabel, DataListValue } from "@/components/cobalt/ui/data-list";
import { compactMoney, date, integer } from "@/lib/cobalt/format";

// As the filing gives them: whole dollars, a count and an ISO date.
const fund = {
  grossAssets: 4_812_640_000,
  domicile: "Cayman Islands",
  auditor: "Whitfield & Lane LLP",
  holdings: 186,
  firstFiled: "2014-03-03",
};

const facts: [string, string][] = [
  ["Gross assets", compactMoney(fund.grossAssets)],
  ["Domicile", fund.domicile],
  ["Auditor", fund.auditor],
  ["Holdings", integer(fund.holdings)],
  ["First filed", date(fund.firstFiled)],
];

export default function Example() {
  return (
    <DataList className="max-w-sm">
      {facts.map(([label, value]) => (
        <DataListItem key={label}>
          <DataListLabel>{label}</DataListLabel>
          <DataListValue>{value}</DataListValue>
        </DataListItem>
      ))}
    </DataList>
  );
}
```

Example: The facts in a card, where the first label lines up with the title (`docs/system/examples/data-list/in-card.tsx`)

```tsx
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/cobalt/ui/card";
import { DataList, DataListItem, DataListLabel, DataListValue } from "@/components/cobalt/ui/data-list";

const facts: [string, string][] = [
  ["Net assets", "$4.8B"],
  ["Expense ratio", "0.42%"],
  ["Holdings", "186"],
];

export default function Example() {
  return (
    <Card className="w-full max-w-sm">
      <CardHeader>
        <CardTitle>Harbour Large Cap Core</CardTitle>
        <CardDescription>From the filing of Aug 29.</CardDescription>
      </CardHeader>
      <CardContent>
        <DataList>
          {facts.map(([label, value]) => (
            <DataListItem key={label}>
              <DataListLabel>{label}</DataListLabel>
              <DataListValue>{value}</DataListValue>
            </DataListItem>
          ))}
        </DataList>
      </CardContent>
    </Card>
  );
}
```

## Variants

### orientation
- `horizontal`: the label at the start and the value at the end of one line, for a card or a side column. The default. Used at 0 call sites.
- `stacked`: the label above the value, for a record page where values run long; the host lays the items in columns. Used at 0 call sites.

Example: Stacked in two columns, for a record page where values run long (`docs/system/examples/data-list/orientation-stacked.tsx`)

```tsx
import { DataList, DataListItem, DataListLabel, DataListValue } from "@/components/cobalt/ui/data-list";

const facts: [string, string][] = [
  ["Legal name", "Harbour Large Cap Core Fund LP"],
  ["Adviser", "Harbour Capital Advisors"],
  ["Administrator", "Northgate Fund Services (Cayman) Ltd."],
  ["Structure", "Master fund"],
  ["First filed", "Mar 3, 2014"],
  ["Gross assets", "$4.8B"],
];

export default function Example() {
  return (
    <DataList orientation="stacked" className="max-w-xl sm:grid-cols-2">
      {facts.map(([label, value]) => (
        <DataListItem key={label}>
          <DataListLabel>{label}</DataListLabel>
          <DataListValue>{value}</DataListValue>
        </DataListItem>
      ))}
    </DataList>
  );
}
```

## States
| State | Trigger | What the user can do | Shown by, besides color | Checked by |
|---|---|---|---|---|
| filled | the value is text, a number, 0 or a node | read it | the value's text | test |
| missing-value | the value is `missing(reason)` | read why it is not there | the reason's words through MissingValue, such as "Not reported", and `data-missing` with the reason | test |
| none | the value is null, undefined, false or an empty string | read that there is nothing | the word "None", or the `none` text | test |
| dropped | a horizontal value cannot sit beside the 128px label | read it on its own line | the value on the line under its label, at the end | screenshot |
| pending | `pending` on `DataList`, the first load | wait | the labels; a skeleton line in each value's place; `aria-busy` | test |

Example: A value the filing did not give says why, Not reported or Could not be read, so it does not look like it is still loading (`docs/system/examples/data-list/state-missing-value.tsx`)

```tsx
import { DataList, DataListItem, DataListLabel, DataListValue } from "@/components/cobalt/ui/data-list";
import { missing, type Known } from "@/lib/cobalt/missing";

// Inert sample data: a fund's facts as its filing gives them. A fact the filing left out holds its
// reason; a fact it answers with nothing is null.
const facts: [string, Known<string> | null][] = [
  ["Auditor", "Whitfield & Lane LLP"],
  ["Prime broker", missing("not-reported")],
  ["Custodian", missing("unreadable")],
  ["Side pockets", null],
];

export default function Example() {
  return (
    <DataList className="w-full max-w-sm">
      {facts.map(([label, value]) => (
        <DataListItem key={label}>
          <DataListLabel>{label}</DataListLabel>
          <DataListValue>{value}</DataListValue>
        </DataListItem>
      ))}
    </DataList>
  );
}
```

Example: A fact the filing answers with nothing, Side pockets, reads None (`docs/system/examples/data-list/state-missing-value.tsx`)

```tsx
import { DataList, DataListItem, DataListLabel, DataListValue } from "@/components/cobalt/ui/data-list";
import { missing, type Known } from "@/lib/cobalt/missing";

// Inert sample data: a fund's facts as its filing gives them. A fact the filing left out holds its
// reason; a fact it answers with nothing is null.
const facts: [string, Known<string> | null][] = [
  ["Auditor", "Whitfield & Lane LLP"],
  ["Prime broker", missing("not-reported")],
  ["Custodian", missing("unreadable")],
  ["Side pockets", null],
];

export default function Example() {
  return (
    <DataList className="w-full max-w-sm">
      {facts.map(([label, value]) => (
        <DataListItem key={label}>
          <DataListLabel>{label}</DataListLabel>
          <DataListValue>{value}</DataListValue>
        </DataListItem>
      ))}
    </DataList>
  );
}
```

Example: Facts on their first load: the labels show at once and each value holds its line with a skeleton line (`docs/system/examples/data-list/pending.tsx`)

```tsx
import { useEffect, useState } from "react";

import { DataList, DataListItem, DataListLabel, DataListValue } from "@/components/cobalt/ui/data-list";

type Facts = { domicile: string; auditor: string; custodian: string; inception: string };

// Stands in for your API call. It answers after 1.5 seconds.
const readFacts = () =>
  new Promise<Facts>((resolve) =>
    setTimeout(
      () => resolve({ domicile: "Delaware", auditor: "Calder & Rowe LLP", custodian: "Northgate Trust", inception: "March 2011" }),
      1500,
    ),
  );

export default function Example() {
  const [facts, setFacts] = useState<Facts | null>(null);
  useEffect(() => {
    void readFacts().then(setFacts);
  }, []);
  return (
    <DataList pending={facts === null} className="w-full max-w-sm">
      <DataListItem>
        <DataListLabel>Domicile</DataListLabel>
        <DataListValue>{facts?.domicile}</DataListValue>
      </DataListItem>
      <DataListItem>
        <DataListLabel>Auditor</DataListLabel>
        <DataListValue>{facts?.auditor}</DataListValue>
      </DataListItem>
      <DataListItem>
        <DataListLabel>Custodian</DataListLabel>
        <DataListValue>{facts?.custodian}</DataListValue>
      </DataListItem>
      <DataListItem>
        <DataListLabel>Inception</DataListLabel>
        <DataListValue>{facts?.inception}</DataListValue>
      </DataListItem>
    </DataList>
  );
}
```

### State precedence
- Filled, missing-value and none: Not applicable: a value is one of them.
- Pending and missing-value or none: pending wins. A value on its way draws a bar, never "None" or a reason, so nothing reads as missing that is only late.
- Missing-value or none and dropped: both show. "None" is short, so it drops only when the column is under 128px plus its width; "Could not be read" measures 114px at 14px, so it drops beside a label in a column under 128px plus 16px plus 114px.

### Motion
Not applicable: no motion.

## Props

<!-- Props generated from registry/cobalt/ui/data-list.tsx with TypeScript by scripts/props-table.mjs -->
### DataList

| Prop | Type | Default | Purpose |
|---|---|---|---|
| `orientation?` | `"horizontal" \| "stacked"` | `"horizontal"` | `horizontal` the label at the start and the value at the end of one line; `stacked` the label above the value. |
| `pending?` | `boolean` | `false` |  |

Also accepts every native HTML attribute.

### DataListItem

No props of its own.

Also accepts every native `<div>` attribute.

### DataListLabel

No props of its own.

Also accepts every native HTML attribute.

### DataListValue

| Prop | Type | Default | Purpose |
|---|---|---|---|
| `children?` | `ReactNode \| Missing` |  | The value, or `missing(reason)` when the source did not give it. |
| `none?` | `string` | `"None"` | What a value of nothing reads: the answer that there is none. |

Also accepts every native HTML attribute.

`orientation` on `DataList` sets the layout for every pair inside. `pending` on `DataList` holds every value's line on the first load. `DataListValue` takes the value as `children`, or `missing(reason)` from `@/lib/cobalt/missing` when the source did not give it. `none` on `DataListValue` is the text for a value of nothing, such as "Keine" in German. Every native attribute of the `dl`, `div`, `dt` and `dd` passes through, and `className` is for placement, such as `sm:grid-cols-2` on a stacked list.

## Usage

### When to use
- A record page or a card shows the facts about one thing, each with a name.
- A booking, an order or a filing needs its details listed for a person to check.

### When not to use
- The pairs are rows of many things that share columns. Use Table instead.
- The value is a figure that is the point of the page, with its change. Use Stat instead.
- The pairs are settings the person changes. Use Item instead, with a control at the end.

### Rules
- `rule/data-list-say-none`: When a value is missing, pass `missing(reason)` as the value, such as `missing("not-reported")`, and leave `DataListValue` empty only when the answer is that there is nothing, instead of leaving the pair out, writing a dash, or passing `none="Not reported"` for a null, because a gap reads as still loading, a pair that is left out hides that the source did not say, and a reason written into `none` turns every null into that reason, the answers of nothing too. Evidence: principle heuristic: visibility of system status, a missing value is said; person D37; single use docs/system/examples/data-list/state-missing-value.tsx:9-11, two reasons beside a None. Check: test `data-list.test.tsx` renders None for null, undefined and an empty string, and the reason for `missing(reason)`.
  - Don't: `<DataListValue none="Not reported">{fund.broker}</DataListValue>`
  - Do: `<DataListValue>{fund.broker}</DataListValue>` with `broker: missing("not-reported")` in the data
- `rule/data-list-one-thing`: When pairs describe more than 1 thing, such as three funds side by side, use a `Table` instead of a `DataList` per thing, because a table lines the same fact up across things and a list per thing makes the reader hunt for it. Evidence: principle heuristic: recognition rather than recall, one column per fact; single use docs/system/examples/table/in-card.tsx:5-8, three rooms side by side with the same two facts. Check: review of every view that renders more than 1 `DataList` in a row.
  - Don't: `{funds.map((f) => <DataList key={f.id}>...</DataList>)}`
  - Do: `<Table><TableHeader>...</TableHeader><TableBody>{funds.map(...)}</TableBody></Table>`
- `rule/data-list-format-before`: When a value is a number, money or a date, pass it through `@/lib/cobalt/format` first, such as `compactMoney(4.8e9)`, because the list sets tabular figures and alignment but never formats, and a raw 4800000000 is read digit by digit. Evidence: app 2/2 source apps format before display, docs/research/2026-10-17-coverage.md section 3; principle heuristic: match between system and the real world. Check: review.
  - Don't: `<DataListValue>{fund.assets}</DataListValue>`
  - Do: `<DataListValue>{compactMoney(fund.assets)}</DataListValue>`

### Content
- Follows `rule/writing-field-label-noun`.
- `rule/data-list-label-noun`: When writing `DataListLabel`, use the noun for the fact in sentence case, such as "Gross assets", in at most 4 words, instead of a question or a sentence, because the label is scanned down the column to find the fact. Evidence: principle heuristic: recognition rather than recall; app 2/2 source apps label facts with nouns, docs/research/2026-10-17-coverage.md section 3. Check: review of the labels in `docs/system/copy-inventory.tsv`.
  - Don't: `<DataListLabel>What are the fund's gross assets?</DataListLabel>`
  - Do: `<DataListLabel>Gross assets</DataListLabel>`

### Anti-slop
- `rule/data-list-pending-not-none`: When the facts are still loading, pass `pending` to `DataList` instead of rendering the values empty, because an empty value reads "None", which says the fact is missing when it is only late. Evidence: principle heuristic: visibility of system status; measured Fund Census's unknown-versus-empty copy, "Its holdings are unknown here, not empty.", docs/research/2026-10-17-fund-census-states.md section 2. Check: test `data-list.test.tsx` "keeps the labels and holds each value with a skeleton line".
  - Don't: `<DataList><DataListItem><DataListLabel>Auditor</DataListLabel><DataListValue>{data?.auditor}</DataListValue></DataListItem></DataList>` while `data` loads
  - Do: `<DataList pending={!data}><DataListItem><DataListLabel>Auditor</DataListLabel><DataListValue>{data?.auditor}</DataListValue></DataListItem></DataList>`
- `rule/data-list-no-icons`: When labelling a fact in `DataListLabel`, use the word alone instead of an icon beside every label, because a column of 20px glyphs pushes every value 32px further and none of them is findable by shape. Evidence: principle heuristic: aesthetic and minimalist design, one glyph per label makes none findable; person D36. Check: review.
  - Don't: `<DataListLabel><CalendarIcon /> First filed</DataListLabel>`
  - Do: `<DataListLabel>First filed</DataListLabel>`

### Limits
- `rule/data-list-horizontal-width`: When a horizontal list sits in a column under 280px, use `orientation="stacked"` instead, because the label keeps 128px and every value wider than what is left drops to its own line, so the layout is stacked anyway, only end-aligned. Evidence: measured 8 of 10 worst-case values dropped under their labels in a 208px card at 320, and 3 of 10 in a 278px card at 390, docs/system/stress/data-list.tsx. Check: probe docs/system/stress/data-list.tsx on the break-ui harness at 320.
  - Don't: `<DataList className="w-52">`
  - Do: `<DataList orientation="stacked" className="w-52">`

## Accessibility
Rests on the HTML `dl`, `dt` and `dd`.

### Keyboard
| Key | Where focus is | Effect | Focus after | Checked by |
|---|---|---|---|---|
| Tab | before the list | passes over it, since nothing in it is focusable unless a value holds a link | the next focusable element, or a link in a value | by hand |

### ARIA
| Part | Role | Accessible name from | States and properties | Announced | Checked by |
|---|---|---|---|---|---|
| root | list (from `dl`) | none; name it with `aria-label` when there are several on a page | none | the count of items in some screen readers | test |
| label | term (from `dt`) | its text | none | the label, then the value | test |
| value | definition (from `dd`) | its text | `data-missing` with the reason, not exposed | the value, the reason's words, or the `none` text | test |

## Tokens
| Part | State | Token |
|---|---|---|
| label | all | `--muted-foreground` |
| value | filled | `--foreground` |
| value | missing-value | `--muted-foreground`, through MissingValue |
| value | none | `--muted-foreground` |

## Related
- Table: rows of many things that share columns.
- Stat: one figure that is the point, with its change.
- Item: rows the person acts on, such as settings.
- Card: the surface a horizontal list usually sits on.
- RelativeTime: how long ago something happened, in a value.
- MissingValue: the words a value says when the source did not give it.
