Leaderboard
Leaderboard: medal places, thumbnails, numbers and change over a period. Pro · Data and metrics › Metrics and widgets
Installation
npx valyro-cli@latest login
npx valyro-cli@latest add leaderboard
npm install valyro-ui-pro
import 'valyro-ui-pro/styles.css';
import { Leaderboard } from 'valyro-ui-pro';
Props
| Prop | Type | Default | |
|---|---|---|---|
items * | LeaderboardItem[] | Ranked entries, first place first. | |
title | ReactNode | Heading of the board. | |
icon | ReactNode | Icon before the heading. | |
periods | { value: string; label: string }[] | [] | Period choices shown as a switcher in the header. |
period | string | Chosen period (controlled). | |
defaultPeriod | string | Initial period when uncontrolled. | |
onPeriodChange | (period: string) => void | Called with the new period when it changes. | |
medals | boolean | true | Gold, silver and bronze dots on the top three. Default true. |
footer | ReactNode | Note under the list: "Updated hourly". | |
headingLevel | 1 | 2 | 3 | 4 | 5 | 6 | 3 | Level of the heading (default 3). |
locale | string | BCP 47 locale for the rank and rating numbers. | |
labels | Partial<LeaderboardLabels> | Overrides for the built-in English text; keys left out keep their defaults. |
Related components
- Stats Card — Metric cards
- KPI Group — KPI row: value, change vs. previous period, sparkline and progress to goal
- Widget — Dashboard container: title, actions, big number, legend and chart area
- Number Value — Locale-aware number: currency, percent, compact notation and units
- Trend Value — Metric change: arrow, sign and color, as text or a pill
- Proportion Bar — Proportion bar with a legend: storage, budget, breakdown
- Activity Rings — Concentric progress rings toward goals
- Data Table — Tables with search and sorting
- Data Grid — Grid for 100,000 rows: grouping, filters, inline editing
- Virtual List — Virtual list for 100,000 rows
- Bulk Action Bar — Actions for selected rows, with keyboard shortcuts
- List Block — List with images or icons, descriptions and values
Previous: Activity Rings · Next: Line Chart · All Data and metrics