Skip to content
Klarhimmel UI
CTA, offer previewCTA, offer preview

Install

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

The offer of the week as one block: what you get in three to five points, how fast (text), this week's limit (text), and one primary action that is either a link or a…

Import

Import

import Block from '@/components/klarhimmel/blocks/cta-offer';
Also called
  • cta/offer
About
The offer of the week as one block: what you get in three to five points, how fast (text), this week's limit (text), and one primary action that is either a link or a one-field form.
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

This week's offer as one block: three to five points of what you get, a turnaround, a limit, and either a link button or a one-field form. For a general closing call without an offer, cta-card is simpler.

Writing for it

- Points need three to five entries of up to 120 characters each; write what the person receives, as nouns, not what you do. - Turnaround (60) and limit (60) are plain text with their own labels. Write 'Within 24 hours' and 'Five reviews this week', and change the text when the offer changes. - In form mode, fieldType decides keyboard and validation: domain accepts yourcompany.se or a full address, while url insists on a scheme. Pick the one your owners will really type.

Watch out for

Both the form and the link button are always in the markup; mode only hides the other one, and both stay visible in the editor. The sent and error messages appear only when a host sets status, so the block alone never shows a success state.

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

export default function Section() {
  return (
    <Theme theme="brand">
      <BlockSurface>
        <CtaOffer props={{
          "eyebrow": "Name the section",
          "title": "Say what the visitor gets",
          "description": "Say in one or two sentences what you do for the visitor and how you hand it over.",
          "pointsTitle": "Name the list",
          "points": [
            "Say the first thing they get, in a line",
            "Say the second thing they get, in a line and how it is delivered",
            "Say the third thing they get, in a line"
          ],
          "turnaroundLabel": "Name the time",
          "turnaround": "Say how long it takes",
          "limitLabel": "Name the limit",
          "limit": "Say how many are available",
          "mode": "form",
          "link": {
            "label": "Main action",
            "href": "#review"
          },
          "errors": {
            "required": "Say what to fill in",
            "email": "Say how to write a valid email address, with an example",
            "url": "Say how to write a valid web address, with an example",
            "domain": "Say how to write a valid site address"
          },
          "messages": {
            "sent": "Thank the visitor and say what happens next and when it happens",
            "error": "Say that it failed and what to try next"
          },
          "form": {
            "fieldLabel": "Your web address",
            "fieldType": "domain",
            "submit": "Send the request",
            "note": "Say how the address is used and nothing 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 section'Text, up to 60 characters. Optional; empty is not rendered.
titlestring'Say what the visitor gets'Text, up to 120 characters.
descriptionstring'Say in one or two sentences what yo…'Text, up to 300 characters. Optional; empty is not rendered.
pointsstring[]3 itemsList of 3 to 5.
pointsTitlestring'Name the list'Text, up to 60 characters.
turnaroundstring'Say how long it takes'Text, up to 60 characters.
turnaroundLabelstring'Name the time'Text, up to 40 characters.
limitstring'Say how many are available'Text, up to 60 characters.
limitLabelstring'Name the limit'Text, up to 40 characters.
mode'link' | 'form''form'One of 'link', 'form'.
linkLink{…}See the type.
form{ fieldLabel, fieldType, fieldName, submit, note }{…}Fields: fieldLabel, fieldType ('domain' | 'url' | 'email' | 'text'), fieldName (optional), submit, note (optional).
actionstring-Text, up to 300 characters. Optional; empty is not rendered.
method'post' | 'get'-One of 'post', 'get'. Optional; empty is not rendered.
hidden{ }-Optional; empty is not rendered.
captchaboolean-Optional; empty is not rendered.
captchaSitekeystring-Text, up to 100 characters. Optional; empty is not rendered.
status'idle' | 'sent' | 'error'-One of 'idle', 'sent', 'error'. Optional; empty is not rendered.
messages{ sent, error }{…}Fields: sent, error. Optional; empty is not rendered.
errors{ required, email, url, domain }{…}Fields: required (optional), email (optional), url (optional), domain (optional). Optional; empty is not rendered.
headingLevel'1' | '2'-One of '1', '2'. Optional; empty is not rendered.