Leaderboard table — Dashboard block

Pro

dashboard-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-table

Usage

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.

PropTypeDescription
title*stringWordsthe ranking’s heading ("Team’s best sellers")
subtitlestringWordswhat is measured ("Revenue collected")
periodstringWordsthe period, as the host writes it ("October 2026")
rows*Row[]Datathe entries, in the host’s order: the block never ranks them itself
openstringActionthe page of one entry (record: the entry)
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Row rows[] · 9 props
PropTypeDescription
id*string | numberDatathe person’s or source’s id
label*stringWordsthe name of the person, the shop, the channel
substringWordsa second line: the team, the region, the kind of source
avatarstringPicturea picture: a root-relative path (/media/…) or an absolute URL
ranknumberthe rank the host gives (ties keep the host’s rank); the position by default
value*numberthe measure, in the unit `options.format` names (money in cents)
deltanumberthe change in percent against the previous period, as the host computed it
sharenumberthe entry’s share of the total, in percent, as the host computed it
currentbooleanthe person looking at the page
Options options · 4 props
PropTypeDescription
format'number' | 'money' | 'percent'how the value reads; number by default
currencystringDesignISO 4217 for money, EUR by default
lowerIsBetterbooleana fall is good news (returns, response time)
mood'inverse' | 'brand' | 'warm' | 'tint' | stringa 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).

MemberWhat it is for
hrefthe address an action leads to, or null to hide what leads there
actruns a change (subscribe, add to cart, save) and answers { ok } or { ok: false, error }
canwhether the page has this action
moneyformats a price, given in cents
asseta picture’s address as your app serves it
Linkyour router’s link component
cartCountthe cart badge’s number
cartDrawerwhether your app has a cart drawer
cartOpenwhether the cart drawer is open
labelyour 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:

KeyEnglishFrench
newsletter.alreadyYou are already subscribed.Vous êtes déjà inscrit.
newsletter.doneDone: you are subscribed.C’est noté : vous êtes inscrit.
newsletter.invalidCheck the email address.Vérifiez l’adresse e-mail.
newsletter.tooManyToo 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 rows from 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.

All 20 dashboard blocks