Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Single Stat Metric Banner Block for React

A one-figure metric banner for a product-analytics tool: a capacity ring in a framed figure, a big figure that rolls up from zero, the limit, this week's change and a link.

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 single-figure metric banner for React with Base UI, for one number that matters, with its limit. A capacity ring sits in a framed figure at the start, with hairlines and + marks on its corners, beside the label, a big figure that rolls up from zero when it scrolls into view, and "of 15,000 seats". At the end, this week's change and a link with an arrow that mirrors in right-to-left layouts. The ring is your theme's foreground, and the percentage inside it is worked out from the figure and the limit. It's built from Circular Progress, Sliding Number and Guides, with your theme's tokens for every colour. For seat counts, plan limits, goals and any number measured against a ceiling.

FAQ

How do I change the figure and the limit?

Edit SEATS at the top of the file: used and limit are numbers, and the percentage in the ring (SHARE) is worked out from them, so it always agrees. The weekly change and the limit as text are plain strings. The big figure is a Sliding Number: pass it a new value (a live count, a poll) and the digits that changed roll to the new number.

When does the figure roll, and what about reduced motion?

It waits at zero until the banner is a quarter in view, then rolls to its value once. With reduced motion the digits change in place with no roll. The digits are hidden from assistive technology and replaced with the number as plain text ("12,847"), so a screen reader reads the figure at once, never the roll.

Is the ring read to screen readers?

No. It is a picture of the same number, so it is hidden from assistive technology; the label, the figure and "of 15,000 seats" are plain text and say the same thing. The percentage in its middle sits in a bdi so a right-to-left layout keeps the sign in order.

What happens when the seats run out?

Nothing changes colour here: the ring stays your theme's foreground. When the number reaches the limit, swap the ring's stroke for the warning or destructive token (**:data-[slot=circular-progress-range]:stroke-warning) and say it in the text; the colour should only mark a limit that was really reached.

How does it fit on a phone?

Below md the block is a column: the ring and the figure in one row, then the change and the link under it, start-aligned. At 320 pixels the ring shrinks a little and the text wraps; nothing scrolls sideways.

  • Pro

    A two-figure metric banner for a store dashboard: two cells split by a hairline, each with a label, a big figure, its change on last week, a thin bar to the weekly goal and that share in words.

  • Pro

    An API-quota banner for an API platform on a tinted band: a bar with 80% and 95% ticks, the warning colour past the alert, and a hatched stretch to 100% for where the pace leads.

  • Pro

    A storage-quota banner for a cloud-storage service: a heading and an Upgrade button over a stacked bar split by type, with four legend cells on shared hairlines naming each type and its size.

  • Pro

    A split for a platform SLA monitor: copy, four ticks and a button at the start, and at the end one chart of three concentric rings with a legend, whose values a 7, 30 or 90 day toggle swaps.

  • Pro

    Impact Ring Testimonials

    Results and figures

    Four impact rings in a reverse split: each result is a share worked out from the customer's own counts, drawn as a ring with its percentage inside, in cells that share hairlines beside a header with a Shine Button.

  • Pro

    Stat Hero CTA

    Figures and stats

    A reverse split call to action with a giant hollow figure that floods with colour as it scrolls into view in the start cell, then a solid divider, a headline, one sentence, a Shine Button and a quiet second action.