CTA
A call-to-action banner section for landing pages and marketing content.
Basic Usage
Ready to get started?
Dark Variant
Start building today.
The default intent="primary" button uses the theme's accent color, which on the stock light theme resolves to a near-black (oklch(20.5% 0 0)) and washes out on the dark CTA's near-black background. Inside variant="dark", prefer intent="neutral" (light surface) — the same pattern the variant="accent" example below uses to break out of its background color.
Accent Variant
Try WireKit now.
On the accent, a heading, a link component, a prose and a text in the CTA take its text color, as on a filled announcement banner. A control on the accent draws its focus ring in that color too. A card in the CTA has a surface of its own and keeps the page's colors and focus ring for what it holds.
Entrance Animation
Wire a viewport-triggered reveal directly on the section without an extra wrapper. The preview below uses a manual-trigger reveal, so the replay icon at the top right of the preview runs the entrance again:
Ready to get started?
For the typical scroll-into-view case, use the animateIn prop directly on the CTA — equivalent to wrapping the component in <x-wirekit:: but skips the wrapper element:
<x-wirekit::cta animateIn="slide-up">
<x-slot:title>Ready to get started?</x-slot:title>
<x-slot:actions>
<x-wirekit::button>Sign Up Free</x-wirekit::button>
</x-slot:actions>
</x-wirekit::cta>
The animateIn prop accepts any of the 11 base presets (fade, slide-up, slide-down, slide-left, slide-right, scale, zoom, flip, rotate, bounce, spring) and respects prefers-reduced-motion: reduce.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
level |
int | 2 |
Heading level for the title, 1–6. 2 suits a section of its own. Set it to match the page's outline, so that no level is skipped; Lighthouse reports a skipped one as heading-order. |
variant |
string | 'default' |
Visual variant: default, dark, accent |
animateIn |
string|null | null |
Entrance-reveal preset (e.g. 'fade', 'slide-up'). Wires reveal semantics inline. |
size |
sm | md | lg |
md |
Vertical-rhythm tier. Reads --space-wk-section-{size} tokens. Mobile viewport (< sm breakpoint) automatically drops one tier so the section never overshoots a small viewport. See hero docs for the full breakpoint table — cta follows the same shape. |
title |
string|null | null |
The heading. The title slot takes the same place and wins when both are given — use it when the heading carries markup |
description |
string|null | null |
The supporting text under the heading. The description slot takes the same place and wins when both are given — use it for paragraphs or markup |
scope |
string|null | null |
Scoped personalization name |
The three size tiers:
The demo below uses variant="default" so the size differences are observable; on variant="accent" or variant="dark" CTAs, use intent="neutral" on the button (see Dark Variant above, which explains why) — the default intent="primary" button shares its background color with the accent / dark CTA surface and visually vanishes.
Tight CTA
Balanced CTA
Roomy CTA
Slots
| Slot | Description |
|---|---|
title |
CTA heading (h2 by default), when it carries markup. A plain heading can be the title prop |
description |
Supporting text, when it carries markup. Plain text can be the description prop |
actions |
CTA buttons |
Keyboard Interaction
This component is a layout wrapper. Keyboard interaction is delegated to its children.
Pitfalls
- Don't hardcode
text-whiteon the accent variant. Usetext-[var(--color-wk-accent-fg)]so the foreground switches with the accent in dark mode and keeps its contrast (WCAG 1.4.3).
Design Tokens
| Token | Used for |
|---|---|
--space-wk-section-md |
Vertical padding |
--font-wk-heading-weight |
Title weight |
--color-wk-bg-muted |
Default background |
--color-wk-bg |
Dark variant background, read inside the band's own dark scope |
--color-wk-accent |
Accent variant background |
Usage & Conventions
Prop conventions — this component uses one or more of the shared semantic prop names (
intent/variant/tone/surface). See Prop naming conventions for the canonical vocabulary, alias matrix, and decision tree.