Skip to content
Klarhimmel UI

Hero, bento cells

Hero, bento cells previewHero, bento cells preview

Install

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

An uneven mosaic of cells on a twelve-part grid: a tall heading cell, a picture, two large-figure cells, a wide picture and a small card with the buttons.

Import

Import

import Block from '@/components/klarhimmel/blocks/hero-bento-cells';
Also called
  • hero/bento-cells
About
An uneven mosaic of cells on a twelve-part grid: a tall heading cell, a picture, two large-figure cells, a wide picture and a small card with the buttons. Two columns on a tablet, one 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

An uneven mosaic opening: a tall heading cell, a picture, two large figures, a wide picture and a small card with the buttons. Use stats-cards when the figures are the point and there are no pictures.

Writing for it

- Title up to 100 characters; lead up to 200. - Two figure cells: a value up to 20 characters and a label up to 60; the first is tinted, the second quiet. - The card takes a title up to 80, a line up to 160 and up to two buttons.

Watch out for

Every cell is real content, so fill all of them or use a simpler hero. The grid has twelve parts on a wide screen, six on a tablet and one on a phone, and the cells keep their order, so the figures land between the two pictures.

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 HeroBentoCells from '@/components/klarhimmel/blocks/hero-bento-cells';

export default function Section() {
  return (
    <Theme theme="brand">
      <BlockSurface>
        <HeroBentoCells 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.",
          "media": {
            "src": "/pictures/photo-spa1.avif",
            "alt": "A treatment room with a massage table by a window"
          },
          "caption": "Say what the picture shows.",
          "stats": [
            {
              "value": "000+",
              "label": "Say what the first number counts"
            },
            {
              "value": "00",
              "label": "Say what the second number counts"
            }
          ],
          "closing": {
            "src": "/pictures/photo-surf1.avif",
            "alt": "Surfboards lined up against a tree"
          },
          "closingCaption": "Say what the picture shows.",
          "cardTitle": "Say what the visitor can do next",
          "cardText": "Say in a sentence why it is worth doing.",
          "primary": {
            "label": "Main action",
            "href": "#start"
          },
          "secondary": {
            "label": "Second action",
            "href": "#more"
          }
        }} />
      </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.
mediaMedia{…}See the type.
captionstring'Say what the picture shows.'Text, up to 120 characters.
stats{ value, label }[]2 itemsList of 2 to 2. Each item: value, label.
closingMedia{…}See the type.
closingCaptionstring'Say what the picture shows.'Text, up to 120 characters.
cardTitlestring'Say what the visitor can do next'Text, up to 80 characters.
cardTextstring'Say in a sentence why it is worth d…'Text, up to 160 characters.
primaryLink{…}Optional; empty is not rendered.
secondaryLink{…}Optional; empty is not rendered.
headingLevel'1' | '2'-One of '1', '2'. Optional; empty is not rendered.