CtaBanner block is a mid-page conversion prompt. It pairs a heading and description with one or more CTA buttons and supports four layout variants — from a simple centred strip to a full image overlay. The backgroundVariant field adjusts button colour treatment to maintain contrast on different backgrounds.
Props
Section heading rendered as
<h2> at 4xl–5xl. Required — Studio validation prevents saving without it.Supporting text below the heading. Rendered as a paragraph with
text-muted-foreground styling.Array of button objects. At least one button is required. The first button uses the primary style; subsequent buttons use outline style (adjusted per
backgroundVariant).Array of images with hotspot support. Only the first image is used. Hidden in Studio when
variant is centered or spread. Required for split (right panel) and overlay (full-width background) variants.Layout variant. Defaults to
centered. See Variants for details.Background colour of the section. Adjusts button colour classes:
primary— primary button usesbg-background text-primary; secondary uses inverted border.dark— secondary button usesborder-background text-backgroundwith hover inversion.white/light— standard button styles.
Vertical padding override. Defaults to
default.Content container max-width. Defaults to
default.Additional CSS classes.
HTML
id for anchor targeting.Button fields
Usage in Sanity Studio
- Add a CTA Banner block to a page.
- Enter a Heading and optional Description.
- Add at least one CTA Button with text and URL.
- Expand Layout Options and choose a Variant.
- If using
splitoroverlay, upload a Background Image with alt text. - Set Background Variant to match your design — this automatically adjusts button contrast colours.
Variants / Options
| Variant | Layout | Image usage |
|---|---|---|
centered | Content centred, max-w-3xl | No image |
split | Text + buttons left, image right (50/50) | First image, 960×1080 |
spread | Heading left, buttons pinned right | No image |
overlay | Full-width image background, centred text on top | First image, 1920×600 with 60% dark overlay |