StealThis .dev

Leaderboard

A ranked leaderboard component with score bars, animated rank changes, medal icons for top 3, avatar initials, and a live-update simulation mode. Ideal for gamification and analytics dashboards.

Open in Lab
vanilla-js css react tailwind vue svelte
Targets: TS JS HTML React Vue Svelte

Code

Features

  • Rank medals — gold/silver/bronze icons for top 3 positions
  • Score bars — animated fill bars proportional to max score
  • Live updates — shuffle scores periodically with smooth re-sort animation
  • Avatar initials — auto-generated colored avatars from names
  • Delta indicators — ▲▼ arrows showing rank change since last update

How it works

  1. Entries are sorted by score descending and assigned rank numbers
  2. Score bars use CSS width transitions for the animated fill
  3. “Live mode” shuffles scores on a timer, re-sorts, and animates position changes
  4. Rank delta is stored between updates and rendered as a colored badge