Skip to main content
The 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 4xl5xl. 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 uses bg-background text-primary; secondary uses inverted border.
  • dark — secondary button uses border-background text-background with 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

  1. Add a CTA Banner block to a page.
  2. Enter a Heading and optional Description.
  3. Add at least one CTA Button with text and URL.
  4. Expand Layout Options and choose a Variant.
  5. If using split or overlay, upload a Background Image with alt text.
  6. Set Background Variant to match your design — this automatically adjusts button contrast colours.
When variant is split or overlay, the Background Images field is shown and should contain at least one image. Without an image, the split variant shows an empty right panel and overlay renders without a background image.

Variants / Options

Example