A ranking table for any league or ladder — sports, esports, quiz nights, debating, sales contests. Position, side, played / won / drawn / lost, score difference and points by default, with configurable columns, your own side highlighted, promotion or play-off lines with a legend, a compact top-N view and an optional form guide.
| Position | Team | Played | Difference | Points |
|---|---|---|---|---|
| 1 | Elmwood | 9 | +13 | 22 |
| 2 | Northgate (your team) | 9 | +9 | 20 |
| 3 | Lakeside | 9 | +5 | 17 |
| 4 | Riverside | 9 | +2 | 15 |
| 5 | Stonebridge | 9 | 0 | 13 |
| 6 | Harbour Town | 9 | −3 | 11 |
| 7 | Westfield | 9 | −7 | 8 |
| 8 | Hillcrest | 9 | −19 | 3 |
- Promotion
- Relegation
Installation
The whole kit as one package — get updates by bumping the version. Add the styles to globals.css: @import "@vamos-ui/react/styles.css";
Usage
import { StandingsTable } from "@vamos-ui/react";
<StandingsTable
caption="North League after round 9"
rows={rows}
highlight="northgate"
zones={[{ after: 2, label: "Promotion" }, { after: 7, label: "Relegation", tone: "muted" }]}
/>Short headers (P, W, D, L, Pts) are visible; screen readers hear the full column names.
Numbers use the locale formatter; negative differences use a true minus sign.
Examples
Compact (top three + your row)
limit keeps the top rows and the highlighted side, with a dashed gap rule; fits a sidebar or a home page.
| Position | Team | Played | Difference | Points |
|---|---|---|---|---|
| 1 | Elmwood | 9 | +13 | 22 |
| 2 | Northgate | 9 | +9 | 20 |
| 3 | Lakeside | 9 | +5 | 17 |
| 6 | Harbour Town (your team) | 9 | −3 | 11 |
Custom columns
Built-in keys mixed with your own column definitions; points passed directly.
| Position | Society | Played | Ballots won | Points |
|---|---|---|---|---|
| 1 | Meridian Society | 6 | 15 | 10 |
| 2 | Oak Hall | 6 | 13 | 8 |
| 3 | Granite Union | 6 | 8 | 4 |
| 4 | Fernside | 6 | 5 | 2 |
API
StandingsTable
| Prop | Type | Default |
|---|---|---|
rowsIn ranked order: { id?, side, position?, played?, won?, drawn?, lost?, for?, against?, points?, form?, …your own fields }. | StandingRow[] | — |
captionNames the table (visually hidden). | string | — |
columnsKeys: played, won, drawn, lost, for, against, score (F:A), difference, points — or { key, label, short?, value(row), numeric?, hideBelow? }. | (StandingsColumnKey | StandingsColumn)[] | ["played", "won", "drawn", "lost", "difference", "points"] |
highlightRow id (or string side) to emphasise; gets aria-current and a spoken "your team". | string | — |
zonesA rule under a position plus a legend entry (accent solid or muted dashed). | { after, label, tone? }[] | — |
limitTop N rows plus the highlighted row. | number | — |
showFormForm guide column (lg and up). Default: when any row has form. | boolean | — |
pointsPerWin / pointsPerDrawUsed when a row has no points. | number | 3 / 1 |
labelsDictionary namespace "standingsTable": column names and short forms, side, form, current. | Partial<StandingsTableLabels> | — |
…Table propsdensity, striped, stickyHeader, bordered … | TableProps | — |
FormGuide
| Prop | Type | Default |
|---|---|---|
formOldest first. role="img" named "Form: Win, Draw, Loss"; letters visible, so colour is not the only signal. | ("win" | "draw" | "loss")[] | — |
sizeSquare size. | "sm" | "md" | "md" |
labelsNamespace "formGuide": win, draw, loss, their short letters, form. | Partial<FormGuideLabels> | — |