Skip to content
Klarhimmel UI

Hero, twin pictures

Hero, twin pictures previewHero, twin pictures preview

Install

npx shadcn add @klarhimmel/hero-twin-pictures
DetailsAbout, usage, props and more

Two columns side by side, each with a label, a heading, a picture with a caption and a name line, then one ruled row under both with a plain link on the left and the…

Import

Import

import Block from '@/components/klarhimmel/blocks/hero-twin-pictures';
Also called
  • hero/twin-pictures
About
Two columns side by side, each with a label, a heading, a picture with a caption and a name line, then one ruled row under both with a plain link on the left and the buttons on the right. The columns stack on a phone.
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

Two subjects side by side, each with its own heading and picture, closed by one ruled row with a link and the buttons. For one picture beside text use hero-split.

Writing for it

- Each column has a label up to 40 characters, a title up to 100, a caption up to 120 and a name line up to 80. - Both columns need a picture; the credit line suits a person or a place. - The closing row takes a plain link and up to two buttons.

Watch out for

The two columns are equal and the headings should be about the same length, or one column ends lower than the other. The block has no single section heading: the first column's title is the one a screen reader announces first.

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 HeroTwinPictures from '@/components/klarhimmel/blocks/hero-twin-pictures';

export default function Section() {
  return (
    <Theme theme="brand">
      <BlockSurface>
        <HeroTwinPictures props={{
          "columns": [
            {
              "eyebrow": "Name the first topic",
              "title": "Say in a few words what the first picture shows",
              "media": {
                "src": "/pictures/photo-book3.avif",
                "alt": "A wooden shelf of books"
              },
              "caption": "Say what the picture shows.",
              "credit": "Name, role"
            },
            {
              "eyebrow": "Name the second topic",
              "title": "Say in a few words what the second picture shows",
              "media": {
                "src": "/pictures/photo-brk1.avif",
                "alt": "A breakfast plate of fruit with orange juice"
              },
              "caption": "Say what the picture shows.",
              "credit": "Name, role"
            }
          ],
          "more": {
            "label": "A plain link",
            "href": "#about"
          },
          "secondary": {
            "label": "Second action",
            "href": "#more"
          },
          "primary": {
            "label": "Main action",
            "href": "#start"
          }
        }} />
      </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
columns{ eyebrow, title, media, caption, credit, action, actionStyle }[]2 itemsList of 2 to 2. Each item: eyebrow, title, media, caption, credit, action (optional), actionStyle ('primary' | 'secondary') (optional).
moreLink{…}Optional; empty is not rendered.
secondaryLink{…}Optional; empty is not rendered.
primaryLink{…}Optional; empty is not rendered.
titleSize'title'-One of 'title'. Optional; empty is not rendered.