Docs
Installation
A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its badge, button, media-slot dependencies and any missing npm packages, and installs them straight into your project.
npx shadcn add https://staaarter.com/r/split-announcement-hero.jsonPrefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/hero/hero2.tsx instead.
Usage
The file also exports hero2Demo, 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 { Hero2, hero2Demo } from "@/components/blocks/hero/hero2"; export default function Page() { return <Hero2 {...hero2Demo} />; }
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| badge | { label: string } | none | Pill above the heading; only rendered when set. |
| heading | ReactNode | none | Main headline. |
| description | string | undefined | Supporting subtext below the heading. |
| announcements | AnnouncementItem[] | [] | Dated list items below the description. |
| buttons | ButtonItem[] | [] | CTA buttons below the announcement list. |
| image | MediaSlotImage | undefined | Image filling the opposite column; falls back to a placeholder when omitted. |
| className | string | none | Extra classes for the outer section element. |
Types
type AnnouncementItem = { title: string; date?: string; href?: string }; type ButtonItem = { label: string; href?: string; variant?: "default" | "secondary" | "outline" | "ghost" | "link" | "destructive"; };
Behavior notes
- The image column always renders (real photo via MediaSlot's image prop, or its built-in placeholder icon when omitted) and stacks above the content column on mobile.
- An announcement item only wraps in a Link (and gets hover affordance) when it has an href; without one it renders as a static, non-interactive row.
- Badge, announcements, and buttons are each independently optional.
More Hero Blocks
View all →Metrics Counter Hero
Centered hero with a badge pill, dual CTAs, avatar social proof, and stat counters that animate up when scrolled into view.
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.