CTA, offer


Install
npx shadcn add @klarhimmel/cta-offerDetailsAbout, 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
- 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.
Pairs well with
Usage
The block in a page, with its default content (long lists shortened). Every prop is in the table below.
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.
| Prop | Type | Default | Description |
|---|---|---|---|
eyebrow | string | 'Name the section' | Text, up to 60 characters. Optional; empty is not rendered. |
title | string | 'Say what the visitor gets' | Text, up to 120 characters. |
description | string | 'Say in one or two sentences what yo…' | Text, up to 300 characters. Optional; empty is not rendered. |
points | string[] | 3 items | List of 3 to 5. |
pointsTitle | string | 'Name the list' | Text, up to 60 characters. |
turnaround | string | 'Say how long it takes' | Text, up to 60 characters. |
turnaroundLabel | string | 'Name the time' | Text, up to 40 characters. |
limit | string | 'Say how many are available' | Text, up to 60 characters. |
limitLabel | string | 'Name the limit' | Text, up to 40 characters. |
mode | 'link' | 'form' | 'form' | One of 'link', 'form'. |
link | Link | {…} | See the type. |
form | { fieldLabel, fieldType, fieldName, submit, note } | {…} | Fields: fieldLabel, fieldType ('domain' | 'url' | 'email' | 'text'), fieldName (optional), submit, note (optional). |
action | string | - | 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. |
captcha | boolean | - | Optional; empty is not rendered. |
captchaSitekey | string | - | 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. |