Skip to content
Klarhimmel UI

Hero, floating pictures

Hero, floating pictures previewHero, floating pictures preview

Install

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

A large two-line heading, its second line in the accent, a short line and a row of chips, with pictures floating around it at different sizes.

Import

Import

import Block from '@/components/klarhimmel/blocks/hero-floating-media';
Also called
  • hero/floating-media
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 large two-line heading over a line and a row of chips, with up to eight pictures floating around it at different sizes. Choose it for a product that is used in many ways, and hero-split for one clear picture.

Writing for it

- Put the second line of the heading in the accent for the payoff, and keep the first line as the plain statement. - Use each chip for one short use, such as a task a customer hands over, and leave the list empty for none. - Order the pictures as the layout reads them, from left top around to right bottom, so the biggest ones land where the eye starts.

Watch out for

The pictures float around the text only on a wide screen. On a phone they are not part of the layout in the same way, so the heading and chips must carry the message alone.

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 HeroFloatingMedia from '@/components/klarhimmel/blocks/hero-floating-media';

export default function Section() {
  return (
    <Theme theme="brand">
      <BlockSurface>
        <HeroFloatingMedia props={{
          "title": "Name the act",
          "titleAccent": "and its range",
          "description": "Say who it is for and what they no longer have to do themselves. Then say how simply it starts.",
          "chips": [
            "Name a first use",
            "Name a second use",
            "Name a third use"
          ],
          "primary": {
            "label": "Main action",
            "href": "#start"
          },
          "secondary": {
            "label": "Second action",
            "href": "#more"
          },
          "media": [
            {
              "src": "/pictures/photo-brk1.avif",
              "alt": "A breakfast plate of fruit with orange juice"
            },
            {
              "src": "/pictures/photo-camp1.avif",
              "alt": "Tents pitched on grass above a lake"
            },
            {
              "src": "/pictures/photo-clean1.avif",
              "alt": "A bright white kitchen with a marble island"
            }
          ]
        }} />
      </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'Name the act'Text, up to 16 characters.
titleAccentstring'and its range'Text, up to 16 characters.
descriptionstring'Say who it is for and what they no …'Text, up to 160 characters.
chipsstring[]4 itemsList of up to 8.
primaryLink{…}See the type.
secondaryLink{…}Optional; empty is not rendered.
mediaMedia[]8 itemsList of up to 8.
headingLevel'1' | '2'-One of '1', '2'. Optional; empty is not rendered.