Dashral Pro is on the wayGet 30% off at launch

Dashral

Stats hero

The promise and actions, then three numbers that count up, each with its trend.

$ pnpm dlx shadcn@latest add @dashral/hero-stats

When to use

  • The promise and actions, then three numbers that count up with their trend.
  • Products whose results are the pitch: uptime, time saved, revenue recovered.

When not to use

  • New products without numbers to stand behind yet: Centered hero.
  • Numbers you can't back up further down the page: they cost more trust than they win.

Usage

Stats hero with your own data: every prop has the sample as its default, so pass only what you have.

example.tsx
import { HeroStats } from "@/components/dashral/blocks/hero-stats"

<HeroStats
  title="Payments that just work"
  primary={{ label: "Get started", href: "/register" }}
  stats={[
    { value: 99.99, suffix: "%", label: "Uptime" },
    { value: 1_200_000_000, format: { style: "currency", currency: "USD", notation: "compact" }, label: "Processed" },
  ]}
/>

API reference

HeroStats

A hero that leads with proof: the promise and actions on top, then three numbers that count up, each with its trend. Every part comes from props; with reduced motion the numbers are simply there.

PropTypeDefault
statusReact.ReactNode

The badge above the headline; none hides it.

"All systems normal"
titleReact.ReactNodesample
descriptionReact.ReactNodesample
primaryBlockActionsample
secondaryBlockAction | null

The second button; null hides it.

sample
statsHeroStat[]sample

type BlockAction

A button: a link with href, or your handler with onClick.

PropTypeDefault
labelstring—
hrefstring—
onClick() => void—

type HeroStat

PropTypeDefault
labelstring—
valuenumber—
formatIntl.NumberFormatOptions—
suffixstring—
changestring—
trendnumber[]—