Leaderboard table — Dashboard block
Prodashboard-leaderboard-table · for app, analytics pages
Leaderboard table
A long ranking of 12 or more to scan and compare: rank, name, value, change and share columns, the viewer’s own row pinned when outside the top ten
Documentation
Installation
One command copies the block into your project with the shadcn CLI (the registry is set once: Installation).
pnpm dlx shadcn-vue@latest add @trame/dashboard-leaderboard-tableUsage
Its demo data, shortened (Using blocks).
<script setup lang="ts">
import DashboardLeaderboardTable from '@/components/trame/blocks/dashboard/dashboard-leaderboard-table.vue'
const props = {
title: "Team top sellers",
subtitle: "Revenue collected, net of returns",
period: "October 2026",
rows: [
{
id: "s1",
label: "Elise Garnier",
sub: "Portland store",
avatar: "https://images.unsplash.com/photo-1580489944761-15a19d654956?w=200&q=80",
value: 1842000,
delta: 12.4,
share: 24
},
{
id: "s2",
label: "Hugo Lambert",
sub: "Portland store",
avatar: "https://images.unsplash.com/photo-1500648767791-00dcc994a43e?w=200&q=80",
value: 1561000,
delta: 4.1,
share: 20
}
],
open: "seller.open",
options: {
format: "money"
}
}
</script>
<template>
<DashboardLeaderboardTable v-bind="props" />
</template>Props
Each prop says who changes it: Words, Picture, Action, Design, Data.* required.
| Prop | Type | Description |
|---|---|---|
| title* | string | Wordsthe ranking’s heading ("Team’s best sellers") |
| subtitle | string | Wordswhat is measured ("Revenue collected") |
| period | string | Wordsthe period, as the host writes it ("October 2026") |
| rows* | Row[] | Datathe entries, in the host’s order: the block never ranks them itself |
| open | string | Actionthe page of one entry (record: the entry) |
| options | Options | the block’s settings: layout choices and secondary words, read by every variant |
Row rows[] · 9 props
| Prop | Type | Description |
|---|---|---|
| id* | string | number | Datathe person’s or source’s id |
| label* | string | Wordsthe name of the person, the shop, the channel |
| sub | string | Wordsa second line: the team, the region, the kind of source |
| avatar | string | Picturea picture: a root-relative path (/media/…) or an absolute URL |
| rank | number | the rank the host gives (ties keep the host’s rank); the position by default |
| value* | number | the measure, in the unit `options.format` names (money in cents) |
| delta | number | the change in percent against the previous period, as the host computed it |
| share | number | the entry’s share of the total, in percent, as the host computed it |
| current | boolean | the person looking at the page |
Options options · 4 props
| Prop | Type | Description |
|---|---|---|
| format | 'number' | 'money' | 'percent' | how the value reads; number by default |
| currency | string | DesignISO 4217 for money, EUR by default |
| lowerIsBetter | boolean | a fall is good news (returns, response time) |
| mood | 'inverse' | 'brand' | 'warm' | 'tint' | string | a band of the page that redefines the theme surfaces inside it |
What it asks your app for
The block never knows your app: it asks it, through one context provided once, where its links lead, what its actions do, how a price reads and which words to say (The host context).
| Member | What it is for |
|---|---|
| href | the address an action leads to, or null to hide what leads there |
| act | runs a change (subscribe, add to cart, save) and answers { ok } or { ok: false, error } |
| can | whether the page has this action |
| money | formats a price, given in cents |
| asset | a picture’s address as your app serves it |
| Link | your router’s link component |
| cartCount | the cart badge’s number |
| cartDrawer | whether your app has a cart drawer |
| cartOpen | whether the cart drawer is open |
| label | your word for an interface key, or undefined to keep the block’s own |
The words it says itself, in English and French; label(key) replaces any of them:
| Key | English | French |
|---|---|---|
| newsletter.already | You are already subscribed. | Vous êtes déjà inscrit. |
| newsletter.done | Done: you are subscribed. | C’est noté : vous êtes inscrit. |
| newsletter.invalid | Check the email address. | Vérifiez l’adresse e-mail. |
| newsletter.tooMany | Too many attempts, try again in a moment. | Trop de tentatives, réessayez dans un moment. |
Features
- Every word in the server HTML
- Same markup in Vue and React
- Theme tokens only: every theme, light and dark
- Shows what you give it, invents nothing
- No motion; still under reduced motion
- Real buttons and links, a visible focus
- Asks your app through actions:
open - Reads
rowsfrom your app
A dashboard section, for app, analytics pages; it uses @lucide/vue, @vueuse/core.
More dashboard blocks
- Goal progress gauge: one to three scores or quotas as half-dials with the latest value large under the arc and the target as a tick.
- Goal progress rings: two to four daily or monthly goals as concentric rings closing toward their target, with each value, target and share written beside them.
- Goal progress target line: the road to a goal: each measure over time as a line under its dashed target, the band above the target tinted, when how it got there matters.
- Metric tabs: one big chart for several measures: the chart and every figure with its own points become selectable tiles over a single plot, the other figures a quiet strip and the lists two columns under it.
- Overview: an app’s home read from the top: the figures, then the chart, then the lists side by side.
- Project card member: A person-led summary with counters and contact entry, using the merchant's own records only.
- Project card mini: A compact title, progress and figure for a dashboard, using the merchant's own records only.
- Project card: A project summary with figure, progress and team, using the merchant's own records only.