Docs
Installation
A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its button, media-slot dependencies and any missing npm packages, and installs them straight into your project.
npx shadcn add https://staaarter.com/r/layered-screens-hero.jsonPrefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/hero/hero4.tsx instead.
Usage
The file also exports hero4Demo, 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 { Hero4, hero4Demo } from "@/components/blocks/hero/hero4"; export default function Page() { return <Hero4 {...hero4Demo} />; }
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| heading | ReactNode | none | Main headline. |
| description | string | undefined | Supporting subtext below the heading. |
| checklist | ChecklistItem[] | [] | Checkmark list below the description. |
| buttons | ButtonItem[] | [] | CTA buttons below the checklist. |
| screens | [MediaSlotImage?, MediaSlotImage?] | [] | The two overlapping browser-frame screenshots; each falls back to a placeholder when omitted. |
| className | string | none | Extra classes for the outer section element. |
Types
type ChecklistItem = { text: string }; type ButtonItem = { label: string; href?: string; variant?: "default" | "secondary" | "outline" | "ghost" | "link" | "destructive"; };
Behavior notes
- The two browser frames are fixed, decorative window chrome (three dots, no real tab/URL bar) with a slight opposing rotation for depth; positions are hardcoded, not driven by the screens array's length.
- Each frame independently falls back to MediaSlot's placeholder icon when its screens entry (or the whole screens array) is omitted, so the layout still looks complete without real screenshots.
- Checklist 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.
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.
App Showcase Hero
Split hero with a feature checklist and dual store CTAs beside a phone-frame screenshot mockup.