Skip to content
Klarhimmel UI

Hero, header row

Hero, header row previewHero, header row preview

Install

npx shadcn add https://ui.klarhimmel.com/r/hero-header-row.json
DetailsAbout, usage, props and more

A heading and a short lead on the left with the actions on the same row at the right, and a wide picture below, with an optional caption.

Import

Import

import Block from '@/components/klarhimmel/blocks/hero-header-row';
Also called
  • hero/header-row
About
A heading and a short lead on the left with the actions on the same row at the right, and a wide picture below, with an optional caption. On a phone the actions stack under the lead, full width, and the picture follows.
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

A heading and short lead at the left with the actions on the same row at the right, then one wide picture and an optional caption. Pick hero-media-foot when the picture should come first.

Writing for it

- Choose the title size for the page: title for a modest heading and display for a large page opening. - Use the shape of the picture to set the pace. Wide is 21 by 9 and cinema is 16 by 7, so a cinema crop wants a subject along the middle. - Add the caption only when it tells the reader something the picture does not, such as a place or a date.

Watch out for

On a phone the actions stack under the lead at full width and the picture follows at 4 by 3, so the crop changes. Check that the subject survives both shapes.

Usage

The block in a page, with its default content (long lists shortened). Every prop is in the table below.

section.tsx
import { Theme } from '@/components/klarhimmel/theme/style';
import { BlockSurface } from '@/components/klarhimmel/blocks/surface';
import HeroHeaderRow from '@/components/klarhimmel/blocks/hero-header-row';

export default function Section() {
  return (
    <Theme theme="brand">
      <BlockSurface>
        <HeroHeaderRow props={{
          "eyebrow": "Name the topic in two words",
          "title": "Say in one line what this page is about",
          "headingSize": "title",
          "description": "Write one or two short lines on what the reader gets here and who it is for.",
          "primary": {
            "label": "Main action",
            "href": "#start"
          },
          "secondary": {
            "label": "Second action",
            "href": "#more"
          },
          "media": {
            "src": "/pictures/photo-tree1.avif",
            "alt": "An oak canopy seen from below"
          },
          "caption": "",
          "pictureShape": "wide"
        }} />
      </BlockSurface>
    </Theme>
  );
}

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.

PropTypeDefaultDescription
eyebrowstring'Name the topic in two words'Text, up to 40 characters.
titlestring'Say in one line what this page is a…'Text, up to 100 characters.
headingSize'title' | 'display''title'One of 'title', 'display'. Optional; empty is not rendered.
descriptionstring'Write one or two short lines on wha…'Text, up to 200 characters.
primaryLink{…}See the type.
secondaryLink{…}Optional; empty is not rendered.
mediaMedia{…}See the type.
captionstring''Text, up to 120 characters.
pictureShape'wide' | 'cinema''wide'One of 'wide', 'cinema'. Optional; empty is not rendered.
headingLevel'1' | '2'-One of '1', '2'. Optional; empty is not rendered.