Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Trend Sparkline Leaderboard Stats Block for React

A podcast chart in a reverse split: eight shows ranked by this week's listeners, each row with a line of its last eight weeks, the value and the change on last week as an arrow and a sign.

Framework
UI library

Preview

Preview width

Installation

Part of Pro
Pro unlocks the code and one-line install of every Pro button and text effect, plus the MCP for your AI editor.
Have Pro already? Sign in to open it.Opens here as soon as you're Pro.

Overview

A leaderboard with trend sparklines for React with Base UI. A reverse split draws the chart first on desktop, in one hairline frame with + marks on its corners, and the copy at the end across the divider; in the document, and on a phone, the copy comes first. The chart ranks eight podcasts by this week's listeners. Each row has a mono rank, the show and its genre, a 96 by 32 line of the last eight weeks, this week's listeners and the change on last week as an arrow and a sign. Every line is drawn on its own scale, in foreground weights: the earlier weeks light, the last week's segment at full weight, and an HTML dot where it ends, so a flat show and a surging show both show their shape. Ranks, changes and lines are worked out from the typed readings, so the text and the drawings agree. For charts, trackers and anything ranked where momentum matters as much as position.

FAQ

How do I change the shows and the readings?

Edit SHOWS: a name, a genre and the weekly listeners in thousands, oldest first; the last reading is this week. The rows are ranked on the last reading, and the lines, the changes and the headline are computed from the same numbers. Use more weeks by adding readings to every show; the text under the headline reads the count from the data.

Why does every line have its own scale?

A shared scale would flatten a quiet show into a straight line next to a large one. Each line spans its own lowest to highest reading, so its shape tells the story, and the caption says so. The numbers beside it carry the real size, and the accessible name of each line gives its first, last, lowest and highest weeks.

What do the arrow and the sign mean?

They are this week against last week: an arrow up and a plus, an arrow down and a minus, a dash when nothing changed. They don't rely on colour and don't mirror in right-to-left pages, because they show a trend, not a direction of reading. A visually hidden "on last week" completes the phrase for a screen reader.

Is it accessible?

The ranking is an ordered list under a figure with a caption. Each line is an image with a name such as "Gravel Hour, last 8 weeks: from 31.5K to 47.3K, lowest 31.5K in week 1, highest 47.3K in week 8", and the same facts are in the row as text. The lines are drawn left to right in every language (dir="ltr"), and the numbers sit in bdi elements.

How does it fit on a phone?

The copy comes first, then the chart. Each row keeps its rank, name, line and value; the lines shrink and the genre drops away, and a long name wraps to two lines. At 320 pixels nothing scrolls sideways.

  • Pro

    Six web-vitals tiles in one hairline frame, each with a fourteen-day line, its low and high marked by ticks, and a Sort by switch that re-orders them by change, budget used or volatility.

  • Pro

    Three delivery measures as rail-to-rail rows, each with a wide twelve-week line whose change on the week before is a pill pinned to the end of the line, level with the last point.

  • Pro

    A league table with rank movement for eight clubs: an arrow, a word and a number (Up 4) and the two places as microcopy (7 to 3), with the biggest climber and the biggest faller beside it.

  • Pro

    A league table for a pub-quiz league in a split: the header and three season facts at the start, and all twelve teams in dense rows, two columns of six, at the end.

  • Pro

    KPI Bar with Trends Stats

    KPI bands and tiles

    Four figures for a garden-centre analytics tool in cells that share their hairlines, each with its change on the week before and an area chart that runs to the cell's edges and foot.

  • Pro

    Weekly Pace Sparkline Stats

    Goals and progress

    Weekly pacing for a sales team, each line of business with its quarter bar and an eight-week sparkline of that week's bookings.