Skip to content
Klarhimmel UI

Call to action, split

Call to action, split previewCall to action, split preview

Install

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

A panel with a headline, one or two actions and an image beside the copy.

Import

Import

import Block from '@/components/klarhimmel/blocks/cta-split';
Also called
  • cta/split
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

A bordered panel with copy and buttons on one half and an image on the other, to close a page with a picture. For a full-width photo with an overlay, use cta-media; for no image at all, cta-band.

Writing for it

- Title holds 120 and description 240, but the text half is only half the width, so keep the title to one or two lines. - The secondary button is drawn in the quieter secondary style. Use it for a lower-commitment step such as 'See examples'. - The image fills the full height of its half at 4 to 3 on narrow screens, so pick a subject that survives cropping to a tall frame.

Watch out for

On narrow containers the image moves above the text, which changes the reading order from what you see on a wide preview. All text fields are optional, so check that a cleared title does not leave an image with two unlabelled buttons.

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

export default function Section() {
  return (
    <Theme theme="brand">
      <BlockSurface>
        <CtaSplit props={{
          "title": "Say what the visitor can do next",
          "description": "Say in a sentence or two what the first step is and what it costs.",
          "primary": {
            "label": "Main action",
            "href": "#start"
          },
          "secondary": {
            "label": "Second action",
            "href": "#demo"
          },
          "media": {
            "src": "/pictures/photo-party1.avif",
            "alt": "A party table with a cake and balloons"
          }
        }} />
      </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'Say what the visitor can do next'Text, up to 120 characters.
descriptionstring'Say in a sentence or two what the f…'Text, up to 900 characters.
primaryLink{…}Optional; empty is not rendered.
secondaryLink{…}Optional; empty is not rendered.
mediaMedia{…}See the type.
frame'panel' | 'open'-One of 'panel', 'open'. Optional; empty is not rendered.
actionsBelowboolean-Optional; empty is not rendered.
tertiaryLink-Optional; empty is not rendered.
titleSize'title' | 'heading'-One of 'title', 'heading'. Optional; empty is not rendered.
headingLevel'1' | '2'-One of '1', '2'. Optional; empty is not rendered.