Hero, centered


Install
npx shadcn add @klarhimmel/hero-centeredDetailsAbout, usage, props and more
Centered headline, description and two actions, with a wide framed image below.
Import
Import
- hero/centered
- Category
- The first screen: what it is, who it is for, what to do next. New project? Set it up once: /get-started/installation.
Notes
When to use it
The classic opener: centred headline, a description, two actions and a wide image below. Choose hero-split when the image should sit beside the text, and hero-minimal when there is no image.
Writing for it
- The title is the h1 of the page and holds 120 characters. State what the product does for the reader rather than its category. - Description holds 300 characters but reads as a lead paragraph, so two sentences is the useful length. The note (80) sits under the buttons for reassurance such as no card needed. - The media field is a wide framed image and its alt text is required in the defaults, so describe what the screenshot shows.
Watch out for
This block renders the page's only h1. Putting a second hero or another block with an h1 on the same page breaks the heading outline.
Pairs well with
Usage
The block in a page, with its default content (long lists shortened). Every prop is in the table below.
Props
The type, default and text limit of every prop. On a real page, over-limit text is kept and checkSections flags it (Installation, Check a page before you ship); this live preview shows the default until it fits. The panel above edits all props.
| Prop | Type | Default | Description |
|---|---|---|---|
eyebrow | string | 'Name what this is' | Text, up to 60 characters. |
title | string | 'Say what the visitor gets in one li…' | Text, up to 120 characters. |
description | string | 'Say in one or two sentences what it…' | Text, up to 300 characters. |
primary | Link | {…} | Optional; empty is not rendered. |
secondary | Link | {…} | Optional; empty is not rendered. |
note | string | 'Say what makes starting easy.' | Text, up to 80 characters. |
tertiary | Link | - | Optional; empty is not rendered. |
actionsLayout | 'stack' | 'stagger' | 'column' | - | One of 'stack', 'stagger', 'column'. Optional; empty is not rendered. |
media | Media | {…} | Optional; empty is not rendered. |
titleMedia | Media | - | Optional; empty is not rendered. |
titleAfter | string | - | Text, up to 120 characters. Optional; empty is not rendered. |
titleMediaWide | boolean | - | Optional; empty is not rendered. |
actionsBelow | boolean | - | Optional; empty is not rendered. |
align | 'center' | 'start' | - | One of 'center', 'start'. Optional; empty is not rendered. |
titleSize | 'display' | 'section' | 'compact' | - | One of 'display', 'section', 'compact'. Optional; empty is not rendered. |
fullHeight | boolean | - | Optional; empty is not rendered. |
narrowMedia | boolean | - | Optional; empty is not rendered. |
headingLevel | '1' | '2' | - | One of '1', '2'. Optional; empty is not rendered. |