Skip to content
Klarhimmel UI

Hero, picture on both ends

Hero, picture on both ends previewHero, picture on both ends preview

Install

npx shadcn add @klarhimmel/hero-media-bookends
DetailsAbout, usage, props and more

One column: a wide picture, then a centred label, heading, lead and two buttons, then a second wide picture with a caption under it.

Import

Import

import Block from '@/components/klarhimmel/blocks/hero-media-bookends';
Also called
  • hero/media-bookends
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 tall one-column opening with a picture before the text and another after it, for a page that shows two views of one subject. For a single picture use hero-centered.

Writing for it

- Title up to 100 characters; description up to 200. - The first picture leads the page, so give it the strongest subject; the second one needs a caption up to 120 characters. - Two buttons at most, centred under the lead.

Watch out for

Both pictures are wide 16 by 9 bands, so the section is long on a phone. Use two different views, not the same picture twice, and keep the text between them short enough that the second picture is still near.

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 HeroMediaBookends from '@/components/klarhimmel/blocks/hero-media-bookends';

export default function Section() {
  return (
    <Theme theme="brand">
      <BlockSurface>
        <HeroMediaBookends props={{
          "media": {
            "src": "/pictures/photo-house1.avif",
            "alt": "A red wooden house with white windows and a white door"
          },
          "eyebrow": "Name the topic in a few words",
          "title": "Say in one line what the visitor gets",
          "description": "Say what the page offers and who it suits, in one or two short lines.",
          "primary": {
            "label": "Main action",
            "href": "#start"
          },
          "secondary": {
            "label": "Second action",
            "href": "#more"
          },
          "closing": {
            "src": "/pictures/photo-key2.avif",
            "alt": "A key in the lock of a green door"
          },
          "caption": "Say what the picture shows."
        }} />
      </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
mediaMedia{…}See the type.
eyebrowstring'Name the topic in a few words'Text, up to 40 characters.
titlestring'Say in one line what the visitor ge…'Text, up to 100 characters.
descriptionstring'Say what the page offers and who it…'Text, up to 200 characters.
primaryLink{…}Optional; empty is not rendered.
secondaryLink{…}Optional; empty is not rendered.
closingMedia{…}See the type.
captionstring'Say what the picture shows.'Text, up to 120 characters.
headingLevel'1' | '2'-One of '1', '2'. Optional; empty is not rendered.