Skip to content
caliper ui pro docs

Leaderboard

A compact board for a team, a class or a sales floor. The top three are set apart, period tabs switch the board at once, and when scores come in the rows travel to their new places with a mark for how far each one moved. Your own row stays pinned under the list when you are outside it.

Pro

Sales floor

Points from closed deals, October

Paused
  1. 1st: Ines VargaNorth team980 points
  2. 2nd: Tomas HaleHarbour team970 points
  3. 3rd: Priya AnandCentral team960 points
  4. 4th: Jun OkaforEast team860 points
  5. 5th: Mara LindNorth team850 points
  6. 6th: Owen PriceHarbour team750 points
  7. 7th: Saskia BrandtCentral team740 points
  8. 8th: Leo MarshEast team730 points
  1. 14th: Elsie ParkYouHarbour team400 points

When to use

  • Sales targets, study streaks, community points or a hack-day scoreboard.
  • Any ranking that changes while people watch it.

When not to use

  • Rankings of people who did not opt in to being compared.
  • A podium moment for a winners’ page; use `podium-rise`.
  • Plain sorted data with no sense of competition; use a table.

Installation

terminal
pnpm dlx shadcn@latest add @caliper/leaderboard

Adds its 10 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.

API reference

Leaderboard

14 props
PropTypeDefaultDescription
entries *readonly LeaderboardEntry[]—Everyone on the board for the current period, in any order.
periodsreadonly { value: string; label: string; }[]—Tabs above the board, such as this week, this month and all time.
periodstring—
onPeriodChange((period: string) => void)—
viewerIdstring—The person looking; their row is marked and pinned when it falls outside `limit`.
limitnumber10How many rows to show before the pinned row.
unitstring"points"What the score counts, read with each score.
titlestring"Leaderboard"
descriptionReactNode—
actionReactNode—Something beside the title, such as a live indicator.
loadingbooleanfalse
errorstring—Why the board could not load. Shows Retry when `onRetry` is given.
onRetry(() => void)—
classNamestring—

rankEntries

0 props

No props of its own; it accepts the native props of its root element.

rankOrdinal

0 props

No props of its own; it accepts the native props of its root element.

Keyboard

  • Keyboard and focus come from Radix tabs: arrow keys move through items, Enter and Space select, and Escape closes and returns focus.

Accessibility

It exposes status and alert semantics, with aria-label, aria-hidden and aria-current kept in step with state. Changes that matter are announced through a live region.

Notes for AI

Give your coding assistant this page as Markdown instead of screenshots: the props, keyboard and examples in one file.

/docs/components/leaderboard.md

The index of every part is at /llms.txt.

More in Work tracking