Skip to content
ProLifetime access for $199, paid once, every future release included
Truffle UI

Leaderboard

ProNew

A ranking with its evidence: score bars that fill from the top place down, confidence intervals as whiskers, and how many places each entry moved.

Installation

pnpm dlx shadcn@latest add @viewport/leaderboard

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

PropTypeDefault
title*string—
metric*string

What the score is, e.g. "Accuracy (%)".

—
entries*LeaderboardEntry[]—
maxnumber

The top of the score scale. Defaults to the highest score with its margin.

—
format(score: number) => string(score) => score.toFixed(1)
accentstring

The bar color of the featured entry.

"oklch(0.7 0.12 235)"
classNamestring—

Accessibility

  • An ordered list, sorted by score in the component so order and data cannot disagree.
  • Movement is an arrow, a number and a word for screen readers.
  • The margin is written beside the score as well as drawn.
  • Bars are shown filled under reduced motion.