Skip to content
Klarhimmel UI

Hero, diagonal

Hero, diagonal previewHero, diagonal preview

Install

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

Three steps down a diagonal on a wide screen: a large heading with its lead at the top left, the actions on a row in the middle, offset to the right, and a picture at…

Import

Import

import Block from '@/components/klarhimmel/blocks/hero-diagonal';
Also called
  • hero/diagonal
About
Three steps down a diagonal on a wide screen: a large heading with its lead at the top left, the actions on a row in the middle, offset to the right, and a picture at the lower right. One column 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

A bold opening that steps down the page: a very large heading top left, the actions offset to the right under it, and a picture lower right. Pick hero-minimal for a plain heading with no picture.

Writing for it

- Title up to 100 characters; it draws at display size, so two short lines is the most that fits. - Lead up to 200 characters and an optional paragraph up to 300. - Up to two buttons and a plain third link.

Watch out for

The offset needs room, so it works from a medium width up; narrow containers draw one column in reading order. A long title pushes the actions far from the picture, so keep it short.

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 HeroDiagonal from '@/components/klarhimmel/blocks/hero-diagonal';

export default function Section() {
  return (
    <Theme theme="brand">
      <BlockSurface>
        <HeroDiagonal props={{
          "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.",
          "body": "Say in two or three lines what the visitor needs to know before they act.",
          "primary": {
            "label": "Main action",
            "href": "#start"
          },
          "secondary": {
            "label": "Second action",
            "href": "#more"
          },
          "more": {
            "label": "A plain link",
            "href": "#about"
          },
          "media": {
            "src": "/pictures/photo-optic1.avif",
            "alt": "Silver-framed glasses on a white table"
          },
          "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
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.
bodystring'Say in two or three lines what the …'Text, up to 300 characters.
primaryLink{…}Optional; empty is not rendered.
secondaryLink{…}Optional; empty is not rendered.
moreLink{…}Optional; empty is not rendered.
mediaMedia{…}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.