Skip to content
Klarhimmel UI

Hero, cover

Hero, cover previewHero, cover preview

Install

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

Their own photo full-bleed under a dark scrim, with their name or wordmark logo, one line, an optional real rating and one or two buttons on it (the second in the…

Import

Import

import Block from '@/components/klarhimmel/blocks/hero-cover';
Also called
  • hero/cover
About
Their own photo full-bleed under a dark scrim, with their name or wordmark logo, one line, an optional real rating and one or two buttons on it (the second in the brand's second colour), centred or at the foot.
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 business whose own site opens on a dark photo with its name or wordmark on it: a bakery, salon, restaurant or shop. Their photo fills the band under a dark scrim, with the name (or their logo), one line, an optional real rating and one button. For a picture beside the words, use hero-split.

Writing for it

- The title (60) is the business's name and the page's h1. With a logo image (light on transparent) the logo shows and the name stays the h1 for screen readers. - The tagline (160) is one line in their words; the rating (80) is their real one as they state it ('4.8 · 612 Google reviews'), else empty. - Use their own photo, wide, with the subject away from the middle third where the text sits. The alt names what is in it.

Watch out for

The scrim never goes under 55% black, so a bright photo comes out darker than the source. Text and the button stay light in dark mode too. Without a photo a real page shows a plain near-black band; the directory and the editor keep the slot.

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

export default function Section() {
  return (
    <Theme theme="brand">
      <BlockSurface>
        <HeroCover props={{
          "title": "Business name",
          "titleStrong": "",
          "logo": {
            "src": "/pictures/logo-lindholmen-logistik.svg",
            "alt": "A company logo",
            "srcDark": "/pictures/logo-lindholmen-logistik-dark.svg"
          },
          "tagline": "Say what you offer, where and since when, in one line.",
          "rating": "0.0 · 000 reviews",
          "action": {
            "label": "Main action",
            "href": "#menu"
          },
          "media": {
            "src": "/pictures/photo-barber1.avif",
            "alt": "An empty barbershop with chairs and mirrors"
          },
          "align": "center"
        }} />
      </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
titlestring'Business name'Text, up to 60 characters.
titleStrongstring''Text, up to 40 characters. Optional; empty is not rendered.
logoMedia{…}See the type.
taglinestring'Say what you offer, where and since…'Text, up to 400 characters.
ratingstring'0.0 · 000 reviews'Text, up to 80 characters.
actionLink{…}See the type.
secondaryActionLink-Optional; empty is not rendered.
mediaMedia{…}See the type.
align'center' | 'start''center'One of 'center', 'start'. Optional; empty is not rendered.
alignPhone'center' | 'start'-One of 'center', 'start'. Optional; empty is not rendered.
fullHeightboolean-Optional; empty is not rendered.
actionsBelowboolean-Optional; empty is not rendered.
headingLevel'1' | '2'-One of '1', '2'. Optional; empty is not rendered.