PairList

PairList screenshot

When to use

To surface a short top-N ranked list of paired items (e.g. “best contrasts”, “most uncertain examples”). Each row links optionally to a detail page or anchor. Best for 3–8 rows.

Example

import PairList from '../../components/widgets/PairList.astro';

<PairList
  heading="Top contrasts"
  pairs={[
    { rank: "1", label: "happy vs sad",  spread: "0.42", href: "#c1" },
    { rank: "2", label: "fast vs slow",  spread: "0.31", href: "#c2" },
    { rank: "3", label: "near vs far",   spread: "0.19" },
  ]}
/>

Props

PropTypeRequiredNotes
headingstringyesSection label rendered at the top of the list.
pairsPair[]yesArray of { rank, label, spread, href? }.

Pair shape:

FieldTypeRequiredNotes
rankstringyesDisplay rank (often “1”, “2”, … but any short string).
labelstringyesItem label or description.
spreadstringyesRight-aligned metric (string so it can include units).
hrefstringnoAnchor or page link. Falls back to #.

When not to use