Skip to content
Klarhimmel UI

Hero, card cover

Hero, card cover previewHero, card cover preview

Install

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

A full-width picture with one centred card over it holding a small label, the heading, one line and two actions.

Import

Import

import Block from '@/components/klarhimmel/blocks/hero-card-cover';
Also called
  • hero/card-cover
About
A full-width picture with one centred card over it holding a small label, the heading, one line and two actions. The card keeps its width on a phone and the actions stack.
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 full-width picture with one centred card over it that holds a label, the heading, a line and two actions. Pick hero-split when the picture should sit beside the text and stay fully visible.

Writing for it

- Choose a picture that stays calm behind a pale card, because the card hides the middle of it and the edges carry the mood. - Write the label as two or three words naming the topic, the heading as the one promise, and use the two actions for the main step and a softer one. - Set the alignment to center for a short, formal opener and to start when the heading runs to two lines.

Watch out for

When the band is set to fill the screen height, a busy photograph can pull attention away from the card. Without it the band is only as tall as the card plus padding, which suits a quieter page.

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 HeroCardCover from '@/components/klarhimmel/blocks/hero-card-cover';

export default function Section() {
  return (
    <Theme theme="brand">
      <BlockSurface>
        <HeroCardCover props={{
          "media": {
            "src": "/pictures/photo-tree1.avif",
            "alt": "An oak canopy seen from below"
          },
          "eyebrow": "Name the topic in two or three words",
          "title": "Say what this page offers, in plain words",
          "description": "Give the reader a short reason to keep going: who it is for and what they get.",
          "primary": {
            "label": "Name the main action",
            "href": "#primary"
          },
          "secondary": {
            "label": "Name the other action",
            "href": "#secondary"
          },
          "fullHeight": true,
          "align": "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
mediaMedia{…}See the type.
eyebrowstring'Name the topic in two or three words'Text, up to 40 characters.
titlestring'Say what this page offers, in plain…'Text, up to 80 characters.
descriptionstring'Give the reader a short reason to k…'Text, up to 200 characters.
primaryLink{…}See the type.
secondaryLink{…}Optional; empty is not rendered.
fullHeightbooleantrueSee the type.
align'start' | 'center''start'One of 'start', 'center'.
headingLevel'1' | '2'-One of '1', '2'. Optional; empty is not rendered.