Skip to content
Calm motion: animations on this site only fade, with no movement

Leaderboard ​

Ranked rows with the place, the move, and the score

Shows who is first, and how each place changed since last time. The row of the reader stands out. It also shows if it is below the top places. For a plain table of data, use the data table.

Basic
Top listeners in November
PlaceNameChangeScore
1Yusufno change52 ep.
2Rarano change48 ep.
3Meiup 241 ep.
3Tonono change41 ep.
5Linanew37 ep.
8Youyouup 319 ep.
  • rows is a list of people or teams. Each row has an id, a name, a score, and an optional avatar. The component puts the rows in order of score, high first.
  • Equal scores share a place, and the next place skips a number: 1, 2, 2, 4.
  • previous is the place of a row last time. The row shows ▲ and the number of places up, ▼ and the number down, or – for no change. A row with no previous is new and shows a dot.
  • The first three places have a filled box in three shades.
  • me is the id of the row of the reader. It has the accent background and a "you" tag. With limit, only the first places show. If the row of the reader is below the limit, it shows after a gap.
  • format sets the text of a score.
  • The leaderboard is a table, and screen readers hear the column names and the move in words, such as "up 2". label names the table. Change the words with labels or a label pack: rank, name, score, change, up and down (functions of the places), same, new, and you.

Usage ​

ts
import { BlessLeaderboard } from "blessing-ui";

API ​

Props

NameTypeDefaultDescription
rows*BlessLeader[]—
mestring | number—the id of the reader's row: it stands out, and it shows even below the limit
limitnumber0show only the first places; 0 shows all
format((v: number) => string)—text for a score, for example `(v) => v + " pts"`
labelstring"Leaderboard"names the table for screen readers
labelsPartial<{ rank: string; name: string; score: string; change: string; up: (places: number) => string; down: (places: number) => string; same: string; new: string; you: string; }>—

Released under the MIT License. Character names and artwork belong to their owners.