Call to action, banner
betaA framed band with a headline revealed word by word, a line of reassurance, two calls to action and small print.
npx rasengan-ui add cta-banner
Send your first invoice in minutes. Senbon chases it for you, and your client pays in one tap.
Free for 14 days. No card needed.
- Use it
- Near the end of a page, to turn interest into one clear action.
- Avoid it
- More than two actions to offer; a page without a clear next step.
- Built with
- ButtonText Reveal
- Pairs with
- Footer, columns
Installation
It installs into components/blocks/cta-banner/, with the components it uses (Button, Text reveal) and
lib/blocks.ts, the field types every block shares.
Usage
Without content, the block shows its example. Pass your own, typed by the block's schema:
Content that comes from elsewhere (a CMS, a file, an agent) can be checked first: schema.parse(data) throws on a
missing field or a headline over 60 characters.
Content
| Field | Type | Limits | Guidance |
|---|---|---|---|
headline | string | 8–60 chars | The one thing to do next, as a promise: 'Ship your landing page today'. |
sublineoptional | string | ≤ 140 chars | One sentence that removes a doubt: price, time, risk. |
primary | object | ||
primary.label | string | 1–32 chars | A verb first, two to four words: 'Start free', 'Book a table'. |
primary.href | string | A path ('/pricing'), an anchor ('#menu'), or a full URL. | |
secondaryoptional | object | ||
secondary.label | string | 1–32 chars | A verb first, two to four words: 'Start free', 'Book a table'. |
secondary.href | string | A path ('/pricing'), an anchor ('#menu'), or a full URL. | |
noteoptional | string | ≤ 60 chars | Small print under the buttons: 'No card needed'. |
Props
| Prop | Notes |
|---|---|
content | CtaBannerContent; the example when left out |
id | the section's id, for anchor links; "cta" by default |
headingLevel | 1, 2 (default) or 3: the headline's tag, so the page keeps one h1 and an unbroken outline |
className | on the <section>, for spacing |
Accessibility
- A
<section>named by its headline (aria-labelledby). - With motion off or reduced, the headline is simply there; it is in the server's HTML either way.
- The actions are links, styled as buttons: they go somewhere.