Installation
npx shadcn@latest add @pixeldosa/product-heroRequires `cn` at `@/lib/utils`, which `npx shadcn init` creates. Supply working action elements through the `actions` slot and a meaningful product visual through `visual`; omit `visual` when the product has no useful preview.
Usage
import { ProductHero } from "@/components/blocks/product-hero";
import { Button } from "@/components/ui/button";
export function ProductPageHero() {
return (
<ProductHero
eyebrow="The workspace for focused teams"
title="Make your best work easier to find."
description="Bring projects, decisions, and next steps into one calm workspace."
variant="split"
actions={
<>
<Button>Get started</Button>
<Button variant="outline">Explore the product</Button>
</>
}
visual={<ProductScreenshot />}
/>
);
}
Choose a composition based on the content: Centered for one focused message, Split when copy and product imagery should share the row, Showcase when the product visual deserves the width, and Editorial for a more text-led opening. Each composition is previewed separately above.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
eyebrow | string | — | Short context line above the headline. |
title | string | — | Required main value proposition. |
description | string | — | Supporting sentence or paragraph. |
actions | React.ReactNode | — | Caller-supplied primary and secondary actions. |
visual | React.ReactNode | — | Product screenshot, illustration, or composed preview. |
variant | "centered" | "split" | "showcase" | "editorial" | "split" | Layout composition. |
headingLevel | 1 | 2 | 3 | 1 | Heading level for the consuming page's outline. |
className | string | — | Additional classes applied to the section. |
why it's built this way
Engineering Notes
Uses a composed slot API for actions and visual rather than embedding a product screenshot, CTA behavior, or a specific brand's copy. Product sites need control over links, analytics, responsive media, and server-rendered imagery, while the block's responsibility is the responsive composition and heading hierarchy. CVA defines the four named layout variants so consumers can extend the matrix without branching through conditional class strings. It is a Level 2 block intended for product-page templates, not a standalone control.
how it moves, and when it doesn't
Motion Notes
The block has no entrance, autoplay, or decorative motion; its job is to establish page hierarchy immediately, and moving content would delay that orientation. CTA controls may use their own interaction feedback, but the hero itself does not animate. Because no motion is introduced, reduced-motion settings do not hide content or change the layout.