Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Counter Stats Hero Block for React

A compact, start-aligned hero for an email API on solid rails: a headline, a Shine Button and an outline button, then four counters in separate cells whose hairlines overshoot their corners.

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 compact hero that lets four numbers make the case, shown here for Plume, an email API. The text is start-aligned: an announcement link, a headline and a sentence on one side, a Shine Button and an outline Button on the other from lg. Below, four counters sit in separate cells whose hairlines overshoot their corners with a + mark on each top-start corner (emails delivered, uptime, API response time and on-call cover), each a display-size value over a label and a short note, growing into place one after another. The hero opens on the page's top rule between the same side rails as the pricing blocks. It's built from Announcement, Badge, Status, Guides, Shine Button and Button, with CSS transitions for the entrance and your theme's tokens for every colour, so it follows your theme, light or dark. For established SaaS products, infrastructure companies, marketplaces, and any landing page where scale and reliability sell.

FAQ

How do I change the stats?

Edit STATS: each has a value, written as it should read (2.4B, 99.99%, 24/7), a label and a note that says what the value means, such as the period it covers. Four fill two rows of two on a phone and one row from the lg breakpoint; with three, change lg:grid-cols-4 to lg:grid-cols-3. Keep each note short and true: a number with its source and period is more convincing than a bigger one.

Can the numbers count up when they come into view?

They're static: each value grows slightly into place as it fades in. To count, swap a value for our Counting Number with trigger="view", and keep the suffix beside it (<CountingNumber value={2.4} decimals={1} trigger="view" />B, or value={99.99} decimals={2} for the uptime). Screen readers then hear the final value, never the count, and with reduced motion the final value shows at once. Values that aren't plain numbers, like 24/7, stay as text.

How do I show live numbers from my API?

Load the stats where your page gets its data and pass them in place of STATS, keeping the same shape. Round them the way people say them (2.4B, not 2,412,908,114), and refresh them on a schedule rather than on every view: a number that changes while someone reads it draws the eye away from the buttons.

How does a screen reader read the stats?

They're a description list: each label is a term, and its value and note are its descriptions, so a screen reader hears "Uptime: 99.99%, over the last 12 months". On screen the value sits above its label, moved there with CSS order, so the reading order stays label first. Each value is in a bdi, so 2.4B keeps its suffix at the end in a right-to-left layout. The headline is the page's one h1.

How does it fit on a phone?

The headline steps down from text-5xl to text-4xl, the buttons wrap below the text, and the four counters sit in two rows of two, their values a step smaller. Both buttons are on the first screen, and nothing scrolls sideways down to 320 px.

  • Pro

    Metric Tiles Hero

    Stats and live data

    A compact left-aligned hero for an edge network with a live status pill, a Shine Button and an outline button at the end of the row, and four metric tiles below, each a ruled cell with a trend.

  • Pro

    Animated Counter Hero

    Stats and live data

    A compact centered hero for an invoicing app with an announcement pill, a Shine Button and a second action, over a hairline band of four figures that count up when they scroll into view.

  • Pro

    Hero With Stats

    Stats and live data

    A split hero with a headline, a Shine Button and a second action beside a rail of four key figures on shared hairlines, each with its period and a small bar trend.

  • Pro

    A compact centred hero for a web framework: an install command with a copy button, two calls to action and a band of three stats.

  • Pro

    Left-Heavy Metric Cards Hero

    Stats and live data

    A split hero for an API host: copy and two calls to action beside a column, behind a divider, of three metric cells whose lines overshoot their corners and whose figures roll up into view.

  • Pro

    Split Stat Overlay Hero

    Stats and live data

    A split hero for a live revenue dashboard: the headline, a checklist and a Shine Button beside a dashboard sketch in a hairline frame, with three stat cards (revenue, users, churn) floating over its edges.