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
string
required
Section heading rendered as
<h2> at 4xl–5xl. Required — Studio validation prevents saving without it.string
Supporting text below the heading. Rendered as a paragraph with
text-muted-foreground styling.Button[]
required
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).SanityImageObject[]
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.'centered' | 'split' | 'spread' | 'overlay'
Layout variant. Defaults to
centered. See Variants for details.'white' | 'light' | 'dark' | 'primary'
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.
'none' | 'small' | 'default' | 'large'
Vertical padding override. Defaults to
default.'narrow' | 'default' | 'full'
Content container max-width. Defaults to
default.string
Additional CSS classes.
string
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.