Staaarter

Metrics Counter Hero

Centered hero with a badge pill, dual CTAs, avatar social proof, and stat counters that animate up when scrolled into view. Perfect for SaaS landing pages that want to lead with traction numbers.

By Staaarter Team
Hero
Docs
Live preview

Docs

Installation

A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its badge, button, avatar, avatar-initials dependencies and any missing npm packages, and installs them straight into your project.

npx shadcn add https://staaarter.com/r/metrics-counter-hero.json

Prefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/hero/hero1.tsx instead.

Usage

The file also exports hero1Demo, the exact props behind the preview above. Spread it to get a working section in one line, then replace it with your own data.

import { Hero1, hero1Demo } from "@/components/blocks/hero/hero1";

export default function Page() {
  return <Hero1 {...hero1Demo} />;
}

Props

PropTypeDefaultDescription
badge{ label: string; href?: string }nonePill above the heading; only rendered when set.
headingReactNodenoneMain headline.
descriptionstringundefinedSupporting subtext below the heading.
buttonsButtonItem[][]CTA buttons below the description.
avatarsAvatarItem[][]Overlapping avatar stack for social proof.
socialProofTextstringundefinedText next to the avatar stack.
countersCounterItem[][]Stat tiles that count up from 0 once scrolled into view.
classNamestringnoneExtra classes for the outer section element.

Types

type ButtonItem = {
  label: string;
  href?: string;
  variant?: "default" | "secondary" | "outline" | "ghost" | "link" | "destructive";
};

type AvatarItem = { name: string; src?: string };

type CounterItem = { label: string; value: number; suffix?: string };

Behavior notes

  • Counters start at 0 and ramp up to their target value over a fixed ~720ms on mount, using a step-based interval (not wall-clock time).
  • The count-up animation runs once per mount and does not repeat or reset afterward.
  • The badge, avatar stack, and counters row are each independently optional; the section still renders a clean centered hero with just heading + buttons if none are supplied.
  • Both CTA buttons are inert placeholders (href defaults to "#" in the demo) with no real navigation target wired up.