Hero: centered product overview
A centered introduction and action above a wide image placeholder for the product preview.
pnpm dlx shadcn@latest add @haze/hero-product-overview---
import { ArrowDown, ArrowRight } from "@lucide/astro";
import { cn } from "../../../lib/haze/utils";
import Button from "../ui/button.astro";
import Placeholder from "../ui/placeholder.astro";
interface Props {
id?: string;
eyebrow?: string;
title?: string;
description?: string;
actionLabel?: string;
actionHref?: string;
previewLabel?: string;
headingLevel?: 1 | 2 | 3;
class?: string;
}
const {
id = "hero-product-overview",
eyebrow = "A clearer way to work",
title = "Make room for the work that matters",
description = "Bring plans, decisions and progress into one shared space, so everyone can move forward with context.",
actionLabel = "Explore the preview",
actionHref,
previewLabel = "Illustrative product interface",
headingLevel = 2,
class: className,
} = Astro.props;
const Heading = ({ 1: "h1", 2: "h2", 3: "h3" } as const)[headingLevel];
---
<section aria-labelledby={`${id}-title`} class={cn("overflow-hidden bg-background px-6 pt-20 pb-16 sm:pt-24 sm:pb-20", className)}>
<div class="mx-auto max-w-6xl">
<div class="animate-rise text-center">
<p class="text-[0.6875rem]/4 font-medium tracking-wider text-muted-foreground uppercase">{eyebrow}</p>
<Heading id={`${id}-title`} class="mx-auto mt-4 max-w-4xl text-4xl/[1.1] font-semibold tracking-tighter text-balance text-foreground sm:text-6xl/[1.08]">{title}</Heading>
<p class="mx-auto mt-5 max-w-2xl text-base/7 text-pretty text-muted-foreground sm:text-lg/8">{description}</p>
<div class="mt-8 flex justify-center"><Button href={actionHref || `#${id}-preview`} size="lg">{actionLabel}{actionHref ? <ArrowRight aria-hidden="true" class="size-4" /> : <ArrowDown aria-hidden="true" class="size-4" />}</Button></div>
</div>
<div id={`${id}-preview`} class="mx-auto mt-12 max-w-5xl animate-rise [animation-delay:80ms] sm:mt-16">
<Placeholder label={previewLabel} variant="app" class="aspect-[4/3] sm:aspect-[16/9]" />
</div>
</div>
</section>When to use
- Introducing a product with room for a broad interface preview
- A single action should lead into the product overview
When not to use
- The introduction needs a form alongside its visual; use hero-split-image
Installation
Add the Haze registry to components.json once, then install Hero: centered product overview with the shadcn CLI. Works in any Astro project with Tailwind CSS v4.
pnpm dlx shadcn@latest add @haze/hero-product-overviewnpx shadcn@latest add @haze/hero-product-overviewyarn dlx shadcn@latest add @haze/hero-product-overviewbunx --bun shadcn@latest add @haze/hero-product-overviewFirst time? Registry and theme setup
1. Add to components.json:
{
"registries": {
"@haze": "http://localhost:4329/r/{name}.json"
}
}2. Install the theme once: npx shadcn@latest add @haze/theme, then import it after Tailwind in your global CSS:@import "./haze.css";
API reference
| Prop | Type | Default | Description |
|---|---|---|---|
| id | string | "hero-product-overview" | Unique section and preview anchor prefix. |
| eyebrow | string | "A clearer way to work" | Short label above the heading. |
| title | string | demo heading | Main introduction. |
| description | string | demo copy | Supporting introduction. |
| actionLabel | string | "Explore the preview" | Text for the primary link. |
| actionHref | string | – | Action destination; defaults to this block's preview anchor. |
| previewLabel | string | "Illustrative product interface" | Accessible description for the illustrative preview. |
| headingLevel | 1 | 2 | 3 | 2 | Heading level for the page context. |
| class | string | – | Additional section classes. |
Keyboard interactions
- Tab, Enter
- Focus and follow the product link.
Accessibility
- The call to action is a native link; without a supplied URL it moves to this section's preview.
- The illustrative interface has an accessible description and the entrance motion respects reduced-motion preferences.
Notes for AI
Copy into Claude Code, Cursor, Codex or any coding agent. Agents can also read the Markdown version of this page.
Install and use
Install the Haze UI block "Hero: centered product overview" with `npx shadcn@latest add @haze/hero-product-overview`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "http://localhost:4329/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import HeroProductOverview from "@/components/haze/blocks/hero-product-overview.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: http://localhost:4329/blocks/hero-product-overview.md
Customize with real content
Adapt the Haze hero-product-overview block for our product. Replace the demo values of these props with our real content: id, eyebrow, title, description, actionLabel, actionHref, previewLabel, headingLevel, class. Keep the layout, the heading level rules and these accessibility details: The call to action is a native link; without a supplied URL it moves to this section's preview. The illustrative interface has an accessible description and the entrance motion respects reduced-motion preferences. Do not add raw color classes; use the Haze tokens.
Choose the right block
Before using hero-product-overview, check it fits: use it when introducing a product with room for a broad interface preview; a single action should lead into the product overview. Avoid it when the introduction needs a form alongside its visual; use hero-split-image. Alternatives: @haze/hero-split-image, @haze/hero-centered.
Dependencies
- npm: @lucide/astro
- @haze/button
- @haze/placeholder
- @haze/utils
- @haze/theme (one-time setup)
Source · Original Haze UI work.