Skip to content
Klarhimmel UI

Hero, split

Hero, split previewHero, split preview

Install

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

Headline, short description and two actions on the left; an image on the right. Stacks in narrow containers.

Import

Import

import Block from '@/components/klarhimmel/blocks/hero-split';
Also called
  • hero/split
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

An opener with text on one side and an image on the other, the usual choice when the picture explains the product. Use hero-centered if the image is wide, and hero-code if the main thing is a command.

Writing for it

- The title here is set a size smaller than in the centred heroes, so it can hold its 120 characters across several lines without dominating the image. - Command (120) is optional and adds a copyable line under the buttons, which suits a product you can try from the terminal. Leave it out for a normal marketing page. - The note holds 80 characters and is optional. Put the pricing or trial terms there, near the buttons.

Watch out for

Only command and note are optional in the schema. Empty media is still drawn as an image slot, so do not leave media out and expect the text to fill the width.

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

export default function Section() {
  return (
    <Theme theme="brand">
      <BlockSurface>
        <HeroSplit props={{
          "eyebrow": "Name what this is",
          "title": "Say what the visitor gets in one line",
          "description": "Say in one or two sentences what it does, who it is for and what the visitor can do next, in plain words.",
          "primary": {
            "label": "Main action",
            "href": "#start"
          },
          "secondary": {
            "label": "Second action",
            "href": "#how"
          },
          "media": {
            "src": "/pictures/scr-shell.avif",
            "alt": "An app shell with a side menu",
            "srcDark": "/pictures/scr-shell-dark.avif"
          },
          "command": "npm create your-app@latest",
          "note": "Say what makes starting easy."
        }} />
      </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 what this is'Text, up to 60 characters.
titlestring'Say what the visitor gets in one li…'Text, up to 120 characters.
descriptionstring'Say in one or two sentences what it…'Text, up to 900 characters. Optional; empty is not rendered.
primaryLink{…}Optional; empty is not rendered.
secondaryLink{…}Optional; empty is not rendered.
mediaMedia{…}See the type.
commandstring'npm create your-app@latest'Text, up to 120 characters. Optional; empty is not rendered.
notestring'Say what makes starting easy.'Text, up to 80 characters. Optional; empty is not rendered.
titleSize'title' | 'display'-One of 'title', 'display'. Optional; empty is not rendered.
actionsBelowboolean-Optional; empty is not rendered.
stats{ value, label }[]-List of up to 4. Each item: value, label. Optional; empty is not rendered.
statsLook'cards'-One of 'cards'. Optional; empty is not rendered.
actionsUnderMediaboolean-Optional; empty is not rendered.
points{ icon, title, description }[]-List of up to 3. Each item: icon ('zap' | 'shield' | 'layers' | 'globe' | 'sparkles' | 'clock' | 'code' | 'palette' | 'lock' | 'chart' | 'users' | 'mail' | 'heart' | 'rocket' | 'search' | 'settings' | 'check' | 'star' | 'book' | 'box' | 'cloud' | 'compass' | 'leaf' | 'gauge'), title, description. Optional; empty is not rendered.
tallboolean-Optional; empty is not rendered.
headingLevel'1' | '2'-One of '1', '2'. Optional; empty is not rendered.