Hero, centred
betaAn announcement, a headline revealed word by word, one line of subcopy, two calls to action and a product shot.
npx rasengan-ui add hero-centered
- Use it
- Opening a product page with a clear one-line promise.
- Avoid it
- Headlines over nine words; a page without a call to action.
- Built with
- ButtonBadgeText Reveal
- Pairs with
- Logos, marqueeFeatures, grid
Installation
It installs into components/blocks/hero-centered/, with what it uses (Button, Badge, Text reveal) and lib/blocks.ts.
Usage
Without content, the block shows its example. Pass your own, typed by the block's schema, from a content file (here, the example with one field changed):
The example's product shot is a placeholder installed in public/placeholders/; replace image with your own screen.
Content
| Field | Type | Limits | Guidance |
|---|---|---|---|
eyebrowoptional | object | A short announcement above the headline, linked: 'New: recurring invoices'. | |
eyebrow.label | string | 1–32 chars | A verb first, two to four words: 'Start free', 'Book a table'. |
eyebrow.href | string | A path ('/pricing'), an anchor ('#menu'), or a full URL. | |
headline | string | 8–70 chars | The product's promise in at most nine words: 'Ship invoices before coffee'. |
subline | string | 20–180 chars | Who it is for and what changes for them, in one or two sentences. |
primary | object | ||
primary.label | string | 1–32 chars | A verb first, two to four words: 'Start free', 'Book a table'. |
primary.href | string | A path ('/pricing'), an anchor ('#menu'), or a full URL. | |
secondaryoptional | object | ||
secondary.label | string | 1–32 chars | A verb first, two to four words: 'Start free', 'Book a table'. |
secondary.href | string | A path ('/pricing'), an anchor ('#menu'), or a full URL. | |
noteoptional | string | ≤ 60 chars | Small print under the buttons: 'Free for 14 days, no card needed'. |
imageoptional | object | A product shot, wide (16:10 or so), shown under the text. Its alt says what the screen shows. | |
image.src | string | A local path ('/images/terrace.jpg') or the project's asset URL. | |
image.alt | string | ≤ 140 chars | What the image shows, for people who cannot see it. Empty only if purely decorative. |
image.width | integer | ||
image.height | integer |
Props
| Prop | Notes |
|---|---|
content | HeroCenteredContent; the example when left out |
id | the section's id, for anchor links; "hero" by default |
headingLevel | 1, 2 or 3: the heading's tag; 1 by default |
className | on the root element, for spacing |
Accessibility
- A
<section>named by its headline, which is the page'sh1by default. - The headline is in the server's HTML; with motion off or reduced it is simply there.
- The product shot loads eagerly (
fetchpriority="high"): it is above the fold. Itsaltsays what the screen shows.