Call to action, card


Install
npx shadcn add @klarhimmel/cta-cardDetailsAbout, usage, props and more
A contained, rounded card with a centred headline, two actions and a row of short reassurances (no card needed, cancel any time).
Import
Import
- cta/card
- About
- A contained, rounded card with a centred headline, two actions and a row of short reassurances (no card needed, cancel any time). Sits inside the page column instead of spanning it.
- 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 contained rounded card with a centred headline, two buttons and a row of short reassurances, sitting inside the page column. Use cta-band when you want full contrast and no reassurance row.
Writing for it
- The points are short check items of up to 80 characters, at most four, and they work best as objections answered: 'No card needed', 'Cancel any time'. - The note (120) is small print under the points. Use it for a fact such as a refund window, not a second slogan. - Eyebrow (60) and description (300) are optional; the title (120) alone can carry a card whose buttons say the rest.
Watch out for
The points row and the note vanish when empty, and an empty primary or secondary label removes that button, so a card with no label on either link is just text. The card is capped at the narrow column width.
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. |
title | string | 'Say what the visitor can do next' | Text, up to 120 characters. |
description | string | 'Say in a sentence or two what the f…' | Text, up to 300 characters. |
primary | Link | {…} | See the type. |
secondary | Link | {…} | See the type. |
points | string[] | 3 items | List of up to 4. |
note | string | 'Say who already uses it, with a num…' | Text, up to 120 characters. |
panel | 'card' | 'plain' | - | One of 'card', 'plain'. Optional; empty is not rendered. |
headingLevel | '1' | '2' | - | One of '1', '2'. Optional; empty is not rendered. |