Skip to content
WingoUI
ComponentsTemplatesDocsPricingAI agentsBlogChangelogContact
Components
Buttons & Actions
ButtonButton GroupCopy ButtonDelete ButtonTheme ToggleToggleToggle Group
Inputs
Avatar UploadCalendarCheckboxColor PickerComboboxCountry SelectCron PickerCurrency InputDate PickerDate Range PickerDate Time PickerDuration PickerEmail InputEmoji PickerFile UploadFilter BuilderInputInput GroupListboxMasked InputMention InputMonth PickerMulti SelectNumber InputOTP InputPassword InputPhone InputRadio GroupRatingSearch InputSegmented ControlSelectSignature PadSliderSwitchTag InputTextareaTime PickerTimezone SelectTree Select
Forms
Address InputBooking WidgetCSV ImportFieldForm WizardInline EditInvoice line itemsRich Text EditorSchema Builder
Navigation
Back To TopBounce SidebarBreadcrumbCommand MenuGlobal SearchGooey NavHook SidebarNav MenuNav TabsPaginationProximity SidebarScroll ProgressSidebarStepsTable Of ContentsTabsTopbarUser MenuWorkspace Switcher
Overlays
Alert DialogContext MenuDialogDrawerDropdown MenuFamily DrawerHover CardPopoverShare DialogSheetShortcuts DialogTooltipTour
Feedback
AlertBannerCookie ConsentEmoji ReactionEmpty StateNotification BellNotification CenterProgressRoute ProgressSetup ChecklistSkeletonSpinnerToast
Data Display
Approval FlowAvatarBadgeCalendar ViewCode BlockComment ThreadContact cardCountdownDescription ListDiff ViewerFile ListFile managerFolderGanttJSON ViewerKbdLog ViewerMarkdownPresenceSchedulerTagTimelineTree View
Tables & Lists
Audit LogData TableDeal PipelineEditable GridKanbanListMembers tablePermissions MatrixTableTask ListVirtual List
Charts & Stats
Animated CounterArea chartBar chartDonut chartFunnel chartGaugeGitHub ActivityHeatmap calendarLeaderboardLine chartRadar chartRadial barSparklineStat CardTrackerTrend badge
Layout
AccordionApp ShellCardCollapsibleDetail LayoutEntity HeaderPage HeaderScroll AreaSeparatorSettings LayoutSplit ViewToolbar
Media
Audio PlayerCarouselCSV ViewerDOCX EditorDOCX ViewerExcel ViewerFile SystemImage compareImage CropperImage GalleryImage LightboxLocation MapPDF ViewerPowerPoint ViewerQR CodeStep PlayerVideo Player
AI Kit
Agent Status CardChat MessageChat ThreadChat WidgetConversation ListFluid OrbGrid RevealMatrix OrbModel PickerPrompt InputReasoning IndicatorRule BuilderSuggestion ChipsTool Call TimelineUsage MeterVoice InputWorkflow Canvas
Text & Effects
Background PatternGravity LettersMarqueeTerminalText AnimateText Rotate
Mobile
Action SheetBottom Tab BarFABHaptic ButtonHero HeaderInstall PromptLarge Title HeaderNotification BannerOnboarding CarouselPicker WheelPull To RefreshSlide To ConfirmSticky CTA BarSwipe DeckSwipeable Tabs
Commerce
Cart drawerCategory pickerCheckout stepsCoupon inputFavorite buttonFilter panelListing cardListing gridOrder trackerPricePrice rangePricing tableProduct galleryQuantity stepperReviewsSeller card
Marketing Sections
App Download SectionBlog Cards SectionCTA SectionFAQ SectionFeature GridFeature ShowcaseHero SectionIntegrations SectionLogo CloudMarketing FooterMarketing HeaderMarketing SectionNewsletter SectionPricing SectionStats SectionSteps SectionTeam SectionTestimonials SectionTimeline SectionVideo Section
Blocks
Admin Dashboard PageAdmin ShellAI Chat PageAPI Keys PageAutomation Builder PageCheckout PageCRM Contact PageCRM Pipeline PageError PagesInbox PageInvoice PageKPI DashboardListing Detail PageLogin PageMarketplace Home PageMarketplace Search PageMarketplace ShellMobile App HomeOnboarding FlowOrder History PagePost Listing WizardPricing PageProfile PageRegister PageSettings PageUsers Admin Page
Templates
About PageAcademy PageAccessibility PageAffiliate PageAgency PageAI Product PageAppointment Booking PageBlog PageBlog Post PageBug Bounty PageCareers PageChangelog PageCommunity PageCompare PageContact PageCustomer Story PageCustomers PageDemo Booking PageDevelopers PageDocs Home PageDownload PageEnterprise PageEvents PageExperts PageFAQ PageFeature PageGlossary PageHelp Article PageHelp Center PageHome Services PageImpact PageIntegration Detail PageIntegrations PageJob Detail PageLanding PageLaunch PageLegal PageManifesto PagePortfolio PagePress PageProduct Tour PagePromo PageReal Estate PageReferral PageResearch Report PageRestaurant PageRoadmap PageROI Calculator PageSecurity PageSolutions PageStartups PageStatus PageStorefront PageSwitch PageTemplate Gallery PageTravel PageWaitlist PageYear in Review Page
Hooks & Utilities
AI ChatChart kitCommerceDate utilsFile exportFile typesFiltersForm validationHapticsInvoicingMotion presetsNavigationNumber formatRelative timeRomanian locationsSpreadsheetText matchTonesUIProvideruseClipboarduseConsentuseControllableStateuseCooldownuseDebounceuseKeyboardInsetuseLocaleuseLongPressuseMediaControlsuseMediaQueryuseOverflowItemsusePersistedStateuseScrollEdgesuseScrollStateuseSelectionuseShortcutuseStickToBottom
GalleryTheme

Charts & Stats

Leaderboard

Charts & Stats

Leaderboard React chart component for Tailwind CSS v4

Heatmap calendarLine chart
Live props
Content
title
metric
highlightId
valueFormat
currency
decimalsAuto
locale
Appearance
variant
size
tone
color
showChange
deltaFormat
invertTrend
podium
showRank
medals
showAvatars
showBars
dividers
Layout
sort
limit5
State
loading
defaultExpanded
Behavior
animated
Code
import { Leaderboard } from "@/components/ui/leaderboard"

<Leaderboard />
  1. Home
  2. Components
  3. Charts & Stats
  4. Leaderboard
Pro

Leaderboard React chart component for Tailwind CSS v4

v1.0.0·Added in 1.0.0

A React leaderboard ranking people, teams or products by one metric, with medals, bars, rank changes, a podium and a "you" row.

Read top to bottom: rank or medal, avatar, name, a bar that shows how far each one is from the leader, the value and the move since last period (a green ▲2, a red ▼1, a gray dash when nothing moved, a blue "New"). The first time it scrolls into view the bars grow and the values count up; when the numbers change, rows glide to their new place and the rank chips pop. With onItemClick every row is a button: Tab lands on the list once, Up / Down, Home / End and PageUp / PageDown move between rows, Enter opens one. "Show all" expands the rest; your own row stays pinned under the top rows with a gap when it falls outside the limit. On a phone rows are at least 44px, the value never truncates (the name does) and the podium keeps three columns down to 320px. Screen readers hear one sentence per row: "Rank 1, Daniel Reed, $48,921, up 1 place". Reduced motion shows the final state at once.

Leaderboard is a Pro React chart component in the React chart and stat components category, written in TypeScript for React 19 and Tailwind CSS v4. It installs as source with npx wingo-ui@latest add leaderboard, together with Avatar, Badge, Button, Chart kit, Motion presets and 6 more and the npm packages motion and lucide-react.

Add to a project

Requirements: React 19 and Tailwind CSS v4, in Next.js (App Router or Pages), Vite or React Router. Installation guide · Next.js setup · Vite setup

npx wingo-ui@latest add leaderboard

Leaderboard is part of Pro, with 298 more Pro items: $8 a month or $150 once. 14-day refund before you download any Pro item. See plans

Usage

Import Leaderboard from @/components/ui/leaderboard.

import { Leaderboard, type LeaderboardItem } from "@/components/ui/leaderboard"

const team: LeaderboardItem[] = [
  { id: "daniel", name: "Daniel Reed", value: 48920.5, avatar: "/demo/mihai-ionescu.jpg", previousRank: 2 },
  { id: "ryan", name: "Ryan Cooper", value: 31200, avatar: "/demo/radu-marin.jpg", previousRank: 1 },
  { id: "emma", name: "Emma Carter", value: 18080, avatar: "/demo/ana-pop.jpg", previousRank: 3 },
  { id: "grace", name: "Grace Kim", value: 14450, avatar: "/demo/maria-toma.jpg", previousRank: 5 },
  { id: "olivia", name: "Olivia Brooks", value: 3450, avatar: "/demo/elena-stan.jpg", previousRank: null },
]

export function TopSellers() {
  return (
    <Leaderboard
      title="Top sellers"
      metric="Revenue, September 2026"
      items={team}
      valueFormat="currency"
      currency="USD"
      locale="en-US"
      highlightId="emma"
      limit={4}
      onItemClick={(item) => console.log(item.id)}
    />
  )
}

Props

  • items*
    LeaderboardItem[]

    { id, name, value, avatar?, icon?, description?, previousRank?, delta?, href?, searchName? }. Ranked by value unless sort is none; equal values share a rank (1, 1, 3). previousRank null marks a new entry. icon replaces the avatar with a tile (products, channels).

  • titledefault ""
    ReactNode

    The heading above the list; also the list's accessible name.

  • metricdefault ""
    ReactNode

    The caption under the title: what is ranked and for which period.

  • highlightIddefault ""
    string

    The id of the current user's row: tinted, with a "You" chip. When it falls outside the limit it is pinned as an extra last row after a gap.

  • valueFormatdefault "number"
    LeaderboardValueFormat = "number" | "compact" | "currency" | "percent"

    How values print, through the chart kit with the locale: "48,921", "49K", "$48,921", "12.4%".

  • currencydefault "USD"
    string

    ISO 4217 code for valueFormat="currency" (and deltaFormat="currency"), printed with its narrow symbol. An unknown code prints as a plain unit after the number.

  • decimalsdefault 0
    number

    Fraction digits for values (0 to 6); auto when unset (Auto in the playground): 0 from 100 up, 1 for percent, up to 2 for small numbers.

  • formatValue
    (value: number, item: LeaderboardItem) => string

    Full control over the value text, e.g. minutes: v => `${v} min`. The count-up and the spoken sentence use it too.

  • localedefault ""
    string

    Intl locale for values and deltas. Empty uses the UIProvider locale, then the page's language.

  • actions
    ReactNode

    Controls at the end of the header: a period picker, a button.

  • variantdefault "surface"
    "surface" | "plain"

    surface is a raised panel (a list group); plain is bare rows for use inside a card or on a page.

  • sizedefault "md"
    "sm" | "md" | "lg"

    Rows at least 44 / 56 / 64px with 32 / 40 / 48px avatars; a description plus a bar adds a little height. sm never goes below 44px, so it stays a full touch target.

  • tonedefault "neutral"
    "neutral" | "brand" | "success" | "warning" | "danger" | "info"

    The bar fill. neutral is the foreground ink (black in light mode, white in dark).

  • colordefault ""
    string

    Any CSS color or a chart palette slot ("series-3") for the bars; replaces the tone.

  • showChangedefault "rank"
    "rank" | "delta" | "none"

    rank: ▲2, ▼1, a gray dash or New, from previousRank. delta: a ghost trend badge from each item's delta. none hides the column.

  • deltaFormatdefault "percent"
    LeaderboardDeltaFormat = "percent" | "number" | "currency"

    How deltas print with showChange="delta" (12.4 is +12,4 %).

  • invertTrenddefault false
    boolean

    With showChange="delta": a falling delta is good and turns green (response time, costs).

  • podiumdefault false
    boolean

    The top three on steps above the list: 2nd left, 1st in the middle and raised with a crown, 3rd right. The list continues from rank 4. Needs at least three items.

  • showRankdefault true
    boolean

    The rank column (numbers or medals).

  • medalsdefault true
    boolean

    Ranks 1 to 3 as gold, silver and bronze discs, in the list and on the podium.

  • medalColorsdefault "["#E8B923", "#A7AFBA", "#C27C4E"]"
    [string, string, string]

    Gold, silver and bronze. The number on each disc turns dark or white by the color's lightness.

  • showAvatarsdefault true
    boolean

    The avatar (photo or initials) or the item's icon tile before the name.

  • showBarsdefault true
    boolean

    A 4px bar under each name, proportional to the largest value. Hidden when the largest value is zero or less.

  • dividersdefault true
    boolean

    Hairlines between rows.

  • sortdefault "desc"
    "desc" | "asc" | "none"

    desc ranks the highest first; asc is for lower-is-better metrics (response time); none keeps the given order.

  • limitdefault 5
    number

    Rows before "Show all" (after the podium when it is on). 0 shows every row; a limit larger than the list hides the button.

  • loadingdefault false
    boolean

    Skeleton rows with the avatar shape; the header stays.

  • defaultExpandeddefault false
    boolean

    Starts with every row shown. Use expanded / onExpandedChange to control it.

  • expanded
    boolean

    Controlled "show all" state.

  • onExpandedChange
    (expanded: boolean) => void

    Fires when Show all / Show less is pressed.

  • emptyState
    ReactNode

    Shown when items is empty. Defaults to a trophy tile with labels.empty.

  • animateddefault true
    boolean

    Bars grow and values count up the first time the list scrolls into view; rows glide to their new place when the order changes and rank chips pop. Off (and under reduced motion) everything renders final.

  • onItemClick
    (item: LeaderboardItem, rank: number) => void

    Makes every row a button with roving focus (Up / Down, Home / End, PageUp / PageDown, Enter).

  • renderLink
    (props: ComponentProps<"a">) => ReactElement

    Renders rows whose item has an href, e.g. props => <Link {...props} href={props.href!} />. Defaults to a plain <a>.

  • labels
    Partial<LeaderboardLabels>

    showAll(n), showLess, you, new, up(n), down(n), same, increase(text), decrease(text), rank(n), item(rank, name, value, change), empty, loading, list, podium. English defaults; item defaults to rank(n), name, value and change joined with commas.

  • classNames
    Partial<Record<"header" | "title" | "metric" | "actions" | "podium" | "list" | "item" | "rank" | "avatar" | "name" | "description" | "value" | "change" | "bar" | "more", string>>

    Extra classes for the inner parts.

  • className
    string

    Extra classes for the root, merged last.

Parts

  • DEFAULT_LEADERBOARD_LABELS

    constant

    The English strings: Show all and Show less, You and New, the spoken rank changes and deltas, each row's sentence, and the empty, loading and list names.

  • LeaderboardItem

    type

    One row: { id, name, value, avatar?, icon?, description?, previousRank?, delta?, href?, searchName? }; previousRank null marks a new entry.

Examples

Podium

The top three on steps above the list; every row is a button with roving focus.

Products

Icon tiles instead of avatars, units through formatValue and deltas vs. last month.

Lower is better

sort="asc" for response time; invertTrend turns a falling delta green.

Pinned you

Your row outside the top five stays pinned under a gap until the list expands.

Sizes and variants

sm / md / lg rows, a brand bar, and the plain variant inside a card with a palette color.

Loading and empty

Skeleton rows with the avatar shape, and the empty state.

Phone

At 360px the podium keeps three columns with smaller avatars; rows stay full-size touch targets.

Dependencies

motionlucide-reactavatarbadgebuttonchart-kitmotionskeletontonestrend-badgeui-configuse-controllable-stateuse-locale

Files

  • components/ui/leaderboard.tsx

FAQ

Is the React Leaderboard chart component free?

The preview, props and docs are free; copying the source needs a Pro plan. See plans.

How do I install Leaderboard?

Run npx wingo-ui@latest add leaderboard. It also adds the Wingo UI items it builds on (Avatar, Badge, Button, Chart kit, Motion presets and 6 more) and the npm packages motion and lucide-react. With shadcn, add the @wingo-ui registry with your API key, then run npx shadcn@latest add @wingo-ui/leaderboard.

How does Leaderboard behave on phones?

On a phone rows are at least 44px, the value never truncates (the name does) and the podium keeps three columns down to 320px.

See also

Trend badgeBar chartFunnel chartAvatarChart kitlib

Used in

KPI DashboardCommunity Page

More React chart and stat components

Area chartDonut chartLine chartRadar chartGaugeGitHub Activity
All 16 React chart and stat components
PreviousHeatmap calendarNext Line chart

Top sellers

Revenue in USD, September 2026

Tap a row or simulate a day of sales.

animated=true · defaultExpanded=false · currency="USD" · deltaFormat="percent" · invertTrend=false