Benchmark Table
ProNewModels across, benchmarks down, with the featured model's column tinted and outlined, missing results marked, and a row and column that light under the pointer.
Installation
pnpm dlx shadcn@latest add @viewport/benchmark-table
First time? Add the @viewport registry to components.json. Setup takes one minute.
Usage
The code behind the preview above comes with Truffle Pro.
Props
| Prop | Type | Default |
|---|---|---|
| models* | BenchmarkModel[] | — |
| rows* | BenchmarkRow[] | — |
| caption* | stringA caption for screen readers and search engines. | — |
| footnote | React.ReactNodeNotes under the table, e.g. what an asterisk means. | — |
| highlightBest | booleanSet the best score in each row in bold. | false |
| accent | stringThe featured column's color. | "oklch(0.7 0.12 235)" |
| surface | stringThe color behind the table. The benchmark column is painted with it, to cover what scrolls underneath. | "var(--background)" |
| format | (value: number) => string | (value) => value.toFixed(1) |
| className | string | — |
Accessibility
- A real table with a caption, column headers and row headers.
- A missing result is read as “No result”, not as a dash.
- Scrolls sideways in a focusable, named region with the benchmark column held in view.
- Featured scores differ in ink weight as well as tint.