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.jsonPrefer 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
| Prop | Type | Default | Description |
|---|---|---|---|
| badge | { label: string; href?: string } | none | Pill above the heading; only rendered when set. |
| heading | ReactNode | none | Main headline. |
| description | string | undefined | Supporting subtext below the heading. |
| buttons | ButtonItem[] | [] | CTA buttons below the description. |
| avatars | AvatarItem[] | [] | Overlapping avatar stack for social proof. |
| socialProofText | string | undefined | Text next to the avatar stack. |
| counters | CounterItem[] | [] | Stat tiles that count up from 0 once scrolled into view. |
| className | string | none | Extra 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.
More Hero Blocks
View all →Split Announcement Hero
Split hero with an image on one side and a short list of dated announcement links on the other.
Dismissible Banner Hero
Centered hero with a dismissible top announcement bar, dual CTAs, trust text, and a wide media panel below.
Layered Screens Hero
Split hero with a feature checklist on one side and two overlapping browser-frame screenshots on the other.
App Showcase Hero
Split hero with a feature checklist and dual store CTAs beside a phone-frame screenshot mockup.