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
| Place | Name | Change | Score |
|---|---|---|---|
| 1 | Yusuf | no change | 52 ep. |
| 2 | Rara | no change | 48 ep. |
| 3 | Mei | up 2 | 41 ep. |
| 3 | Tono | no change | 41 ep. |
| 5 | Lina | new | 37 ep. |
| 8 | Youyou | up 3 | 19 ep. |
rowsis a list of people or teams. Each row has anid, aname, ascore, and an optionalavatar. 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.
previousis 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 nopreviousis new and shows a dot.- The first three places have a filled box in three shades.
meis the id of the row of the reader. It has the accent background and a "you" tag. Withlimit, only the first places show. If the row of the reader is below the limit, it shows after a gap.formatsets 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".
labelnames the table. Change the words withlabelsor a label pack:rank,name,score,change,upanddown(functions of the places),same,new, andyou.
Usage
ts
import { BlessLeaderboard } from "blessing-ui";API
Props
| Name | Type | Default | Description |
|---|---|---|---|
rows* | BlessLeader[] | — | |
me | string | number | — | the id of the reader's row: it stands out, and it shows even below the limit |
limit | number | 0 | show only the first places; 0 shows all |
format | ((v: number) => string) | — | text for a score, for example `(v) => v + " pts"` |
label | string | "Leaderboard" | names the table for screen readers |
labels | Partial<{ rank: string; name: string; score: string; change: string; up: (places: number) => string; down: (places: number) => string; same: string; new: string; you: string; }> | — |