Skip to content
Klarhimmel UI

Call to action, scattered pictures

Call to action, scattered pictures previewCall to action, scattered pictures preview

Install

npx shadcn add @klarhimmel/cta-scattered
DetailsAbout, usage, props and more

A centred call to action (label, heading, lead and two actions) with small pictures scattered around all four sides of the section: four on a phone, eight on a wide…

Import

Import

import Block from '@/components/klarhimmel/blocks/cta-scattered';
Also called
  • cta/scattered
About
A centred call to action (label, heading, lead and two actions) with small pictures scattered around all four sides of the section: four on a phone, eight on a wide screen.
Category
One clear next step near the end of a page. New project? Set it up once: /get-started/installation.

Notes

When to use it

Pick it for a playful closing call to action, centred, with small pictures scattered around every side of the band. For a plain centred band use cta-band; for one large picture beside the text use cta-split.

Writing for it

- The title holds 120 characters, the lead 240 and the label 60. Say what the visitor does next. - Four to eight pictures: the first four sit at the top, bottom, left and right edges, the next four in the corners and show from a tablet width up. - Each picture needs alt text of up to 200 characters; keep each one small and square.

Watch out for

The pictures sit behind the text, so a long lead on a phone can run over the edge pictures. Keep the lead to one sentence and use square pictures with a clear subject.

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 CtaScattered from '@/components/klarhimmel/blocks/cta-scattered';

export default function Section() {
  return (
    <Theme theme="brand">
      <BlockSurface>
        <CtaScattered props={{
          "eyebrow": "Section name",
          "title": "Say what the visitor should do next",
          "description": "Say in one sentence what the visitor gets by taking the action.",
          "primary": {
            "label": "Main action",
            "href": "#start"
          },
          "secondary": {
            "label": "Second action",
            "href": "#contact"
          },
          "pictures": [
            {
              "media": {
                "src": "/pictures/photo-gelato1.avif",
                "alt": "Tubs of gelato in a display case"
              }
            },
            {
              "media": {
                "src": "/pictures/photo-house1.avif",
                "alt": "A red wooden house with white windows and a white door"
              }
            },
            {
              "media": {
                "src": "/pictures/photo-key2.avif",
                "alt": "A key in the lock of a green door"
              }
            }
          ]
        }} />
      </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'Section name'Text, up to 60 characters.
titlestring'Say what the visitor should do next'Text, up to 120 characters.
descriptionstring'Say in one sentence what the visito…'Text, up to 240 characters.
primaryLink{…}See the type.
secondaryLink{…}Optional; empty is not rendered.
pictures{ media }[]8 itemsList of 4 to 8. Each item: media.
headingLevel'1' | '2'-One of '1', '2'. Optional; empty is not rendered.