Skip to content
Haze UI

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.

pnpm dlx shadcn@latest add @haze/hero-centered
Open preview in a new tab
Liveno JavaScript

When to use

  • 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

When not to use

  • 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

Installation

Add the Haze registry to components.json once, then install Hero: centered with announcement badge with the shadcn CLI. Works in any Astro project with Tailwind CSS v4.

pnpm dlx shadcn@latest add @haze/hero-centered
First 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

PropTypeDefaultDescription
badgestring"New: automations for recurring work"Announcement text inside the pill above the headline.
badgeHrefstring"#changelog"Where the badge links to.
titlestringdemo headlineMain headline; keep it under about 70 characters.
descriptionstringdemo copySupporting paragraph under the headline.
primaryLabel / primaryHrefstring"Start for free" / "#start"Primary call to action.
secondaryLabel / secondaryHrefstring"Book a demo" / "#demo"Secondary outline call to action.
headingLevel1 | 21Heading level of the title.
showPreviewbooleantrueShow 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.

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 with announcement badge" with `npx shadcn@latest add @haze/hero-centered`. 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 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: http://localhost:4329/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.

Dependencies

  • npm: @lucide/astro
  • @haze/badge
  • @haze/button
  • @haze/placeholder
  • @haze/theme (one-time setup)

Source · Original Haze UI work.

Catalog

↑↓ moveEnter openEsc close

Keyboard shortcuts

CtrlK
Command palette
/
Focus search
←↑→↓
Move between cards
jk
Next / previous card
ci
Copy code / install command (detail page)
[]
Previous / next entry
?
This help
Esc
Close dialog