Skip to content

Ledger Table

React

Full-bleed rows with the title inside the grid, a numbered rail and sortable headers.

Eval runs, Oct
#
01R-2037atlas-ltool-use0.9571,120pass
02R-2041atlas-lsupport-qa0.912840pass
03R-2040atlas-msupport-qa0.884410pass
04R-2039atlas-ssupport-qa0.801160drift
05R-2038local/32bsupport-qa0.7421,290fail

Install

$ npx shadcn@latest add https://spotcheckui.com/r/ledger-table.json

No motion engine needed.

Usage

import { LedgerTable, type LedgerColumn } from "@/components/spotcheck/ledger-table"

const columns: LedgerColumn<Run>[] = [
  { key: "id", label: "Run", emphasis: true },
  { key: "score", label: "Score", numeric: true },
]

<LedgerTable title="Eval runs" rows={runs} columns={columns} rowKey="id" defaultSort={{ key: "score", dir: "desc" }} />

Sorting needs a client component, so a custom render has to come from one too. Define columns in a "use client" file.

Props

  • title * RequiredstringDefault —Printed inside the table, and names it for screen readers.
  • rows * RequiredRow[]Default —
  • columns * RequiredLedgerColumn<Row>[]Default —
  • rowKey * RequiredstringDefault —The field that uniquely identifies a row.
  • defaultSortLedgerSort<Row>Default —
  • classNamestringDefault —

Keyboard

TabMove between column headers
EnterSort by the focused column
← →Scroll a wide table once it has focus

Reduced motion

Rows invert on hover at once, with no fade.