# Hero: centered with announcement badge

> Centered headline, linked announcement badge, two CTAs and a raised image placeholder. Text rises in on load, then the placeholder.

- Kind: block · Category: Hero · Interactivity: none
- Install: `npx shadcn@latest add @haze/hero-centered`
- File: `src/components/haze/blocks/hero-centered.astro`
- npm dependencies: @lucide/astro
- Registry dependencies: @haze/badge, @haze/button, @haze/placeholder
- Docs page: https://hazeui.com/blocks/hero-centered

## Use when
- The first section of a SaaS landing page
- You have a recent launch to point at from the badge
- A single product screenshot tells the story better than feature bullets

## Avoid when
- The headline needs a form beside it, such as a waitlist; use hero-split-image instead
- You have no product visual yet; set showPreview to false or pick a text-only hero

## Alternatives
- [hero-split-image](https://hazeui.com/blocks/hero-split-image.md)

## Props

| Name | Type | Default | Required | Description |
|---|---|---|---|---|
| badge | `string` | "New: automations for recurring work" | no | Announcement text inside the pill above the headline. |
| badgeHref | `string` | "#changelog" | no | Where the badge links to. |
| title | `string` | demo headline | no | Main headline; keep it under about 70 characters. |
| description | `string` | demo copy | no | Supporting paragraph under the headline. |
| primaryLabel / primaryHref | `string` | "Start for free" / "#start" | no | Primary call to action. |
| secondaryLabel / secondaryHref | `string` | "Book a demo" / "#demo" | no | Secondary outline call to action. |
| headingLevel | `1 \| 2` | 1 | no | Heading level of the title. |
| showPreview | `boolean` | true | no | Show the product screenshot placeholder. |

## Accessibility
- Section is labelled by its heading; the heading level is configurable so the page keeps a single h1.
- The arrow icon is decorative and hidden from assistive technology; the screenshot placeholder has a text alternative.
- The entrance is two short rises (the text group, then the image placeholder 80 ms later). It starts at 40 % opacity, so no text is ever invisible, and it is switched off under prefers-reduced-motion.

## Agent prompts

### Install and use

Install the Haze UI block "Hero: centered with announcement badge" with `npx shadcn@latest add @haze/hero-centered`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/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 HeroCentered from "@/components/haze/blocks/hero-centered.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: https://hazeui.com/blocks/hero-centered.md

### Customize with real content

Adapt the Haze hero-centered block for our product. Replace the demo values of these props with our real content: badge, badgeHref, title, description, primaryLabel / primaryHref, secondaryLabel / secondaryHref, headingLevel, showPreview. Keep the layout, the heading level rules and these accessibility details: Section is labelled by its heading; the heading level is configurable so the page keeps a single h1. The arrow icon is decorative and hidden from assistive technology; the screenshot placeholder has a text alternative. The entrance is two short rises (the text group, then the image placeholder 80 ms later). It starts at 40 % opacity, so no text is ever invisible, and it is switched off under prefers-reduced-motion. Do not add raw color classes; use the Haze tokens.

### Choose the right block

Before using hero-centered, check it fits: use it when the first section of a saas landing page; you have a recent launch to point at from the badge; a single product screenshot tells the story better than feature bullets. Avoid it when the headline needs a form beside it, such as a waitlist; use hero-split-image instead; you have no product visual yet; set showpreview to false or pick a text-only hero. Alternatives: @haze/hero-split-image.

## Example requests that should lead here
- Create a centered landing hero with a 'New' badge linking to the changelog and a big app screenshot
- Add a hero section with headline, subtext, Start for free and Book a demo buttons

## Source

```astro
---
import { ArrowRight } from "@lucide/astro";
import Badge from "../ui/badge.astro";
import Button from "../ui/button.astro";
import Placeholder from "../ui/placeholder.astro";

interface Props {
  badge?: string;
  badgeHref?: string;
  title?: string;
  description?: string;
  primaryLabel?: string;
  primaryHref?: string;
  secondaryLabel?: string;
  secondaryHref?: string;
  /** Use 1 when this hero is the top of the page, 2 when it sits below another heading. */
  headingLevel?: 1 | 2;
  showPreview?: boolean;
}

const {
  badge = "New: automations for recurring work",
  badgeHref = "#changelog",
  title = "Plan, track and ship work without the busywork",
  description = "Driftwork keeps your roadmap, sprints and bug queue in one fast workspace, so the team spends its time on the product instead of the process.",
  primaryLabel = "Start for free",
  primaryHref = "#start",
  secondaryLabel = "Book a demo",
  secondaryHref = "#demo",
  headingLevel = 1,
  showPreview = true,
} = Astro.props;
const Heading = headingLevel === 1 ? "h1" : "h2";
---

<section aria-labelledby="hero-centered-title" class="overflow-hidden bg-background px-6 pt-24 pb-16 sm:pt-32">
  <div class="mx-auto flex max-w-3xl animate-rise flex-col items-center text-center">
    <Badge href={badgeHref}>
      {badge}
      <ArrowRight aria-hidden="true" />
    </Badge>
    <Heading
      id="hero-centered-title"
      class="mt-6 text-4xl/[1.1] font-semibold tracking-tighter text-balance text-foreground sm:text-6xl/[1.05]"
    >
      {title}
    </Heading>
    <p class="mt-6 max-w-2xl text-base/7 text-pretty text-muted-foreground sm:text-lg/8">{description}</p>
    <div class="mt-8 flex flex-col gap-3 sm:flex-row">
      <Button href={primaryHref} size="lg">{primaryLabel}</Button>
      <Button href={secondaryHref} size="lg" variant="outline">{secondaryLabel}</Button>
    </div>
  </div>
  {
    showPreview && (
      <div class="mx-auto mt-16 max-w-5xl animate-rise [animation-delay:80ms]">
        <Placeholder label="Driftwork app showing a sprint board and a velocity chart" elevated class="aspect-[16/9]" />
      </div>
    )
  }
</section>
```
