Call To Action Split
A split call-to-action block — heading and copy on one side, CTA links and an assurance line on the other.
v0.2.0Page blockpayload-website-starter
import type { Block } from 'payload'
import { callToActionFields } from '@/blocks/shared/callToActionFields'
import { linkGroup } from '@/fields/linkGroup'
export const CallToActionSplit: Block = {
slug: 'callToActionSplit',
// Existing apps must migrate stored data before adopting this identifier:import type { Block } from 'payload'import { callToActionFields } from '@/blocks/shared/callToActionFields'import { linkGroup } from '@/fields/linkGroup'export const CallToActionSplit: Block = { slug: 'callToActionSplit', // Existing apps must migrate stored data before adopting this identifier: // https://www.payload-components.xyz/docs/registry#installed-source-and-migrations dbName: 'pc_cal_to_act_spl', interfaceName: 'CallToActionSplitBlock', admin: { group: 'Call to action', }, fields: [ // Shared call-to-action core (title, description). Variant-specific fields // follow; edit the shared shape in @/blocks/shared/callToActionFields. ...callToActionFields, { name: 'assurance', type: 'text', custom: { payloadComponents: { localization: 'localized' } }, admin: { description: 'Optional reassurance line under the actions — pricing, timing, or terms.', }, }, linkGroup({ overrides: { admin: { initCollapsed: true, }, maxRows: 2, minRows: 1, }, }), ], labels: { plural: 'Call To Action Split Blocks', singular: 'Call To Action Split', },}import React from 'react'import type { CallToActionSplitBlock as CallToActionSplitBlockData } from '@/payload-types'import { CMSLink } from '@/components/Link'import { cn } from '@/utilities/ui'type Props = CallToActionSplitBlockData & { id?: string className?: string disableInnerContainer?: boolean}export const CallToActionSplitBlock: React.FC<Props> = ({ assurance, className, description, disableInnerContainer, id, links, title,}) => { return ( <section className={cn('container', className)} id={id ? `block-${id}` : undefined}> <div className="overflow-hidden rounded-frame border border-border/70 bg-card/35 px-6 py-10 sm:px-8 lg:px-12 lg:py-14"> <div className={cn( 'flex flex-col gap-8 lg:flex-row lg:items-center lg:justify-between lg:gap-16', { 'mx-auto max-w-6xl': !disableInnerContainer, }, )} > <div className="flex max-w-2xl flex-col gap-4"> <h2 className="text-4xl font-medium tracking-display text-balance sm:text-5xl"> {title} </h2> {description ? ( <p className="text-base leading-7 text-muted-foreground sm:text-lg">{description}</p> ) : null} </div> {links && links.length > 0 ? ( <div className="flex shrink-0 flex-col gap-3"> <div className="flex flex-col gap-3 sm:flex-row lg:justify-end"> {links.map(({ link }, index) => ( <CMSLink key={index} appearance={link.appearance === 'outline' ? 'outline' : 'default'} {...link} /> ))} </div> {assurance ? ( <p className="text-sm leading-6 text-muted-foreground lg:text-end">{assurance}</p> ) : null} </div> ) : null} </div> </div> </section> )}import type { Field } from 'payload'/** * Shared field core for the Call To Action component family. * * Every call-to-action variant (call-to-action-centered, call-to-action-boxed, * call-to-action-signup, …) spreads these heading fields first and then appends * its own variant-specific shape — the CTA link group for the centered and boxed * layouts, or the email-capture fields for the signup layout. Editing the shared * title/description here updates every installed call-to-action block at once, so * the family never drifts field-by-field across a repo. * * Installed once per repo at `src/blocks/shared/callToActionFields.ts`; re-running * `payload-components add call-to-action-*` never overwrites a copy you have already edited. */export const callToActionFields: Field[] = [ { name: 'title', type: 'text', custom: { payloadComponents: { localization: 'localized' } }, required: true, }, { name: 'description', type: 'textarea', custom: { payloadComponents: { localization: 'localized' } }, },]Installation
npx payload-components add call-to-action-splitnpx shadcn@latest add https://www.payload-components.xyz/r/call-to-action-split.jsonThe registry copy brings the source files only; register the block and map its renderer yourself, or let the CLI command above do both.
Usage
Editors add Call To Action Split from a Page layout's block picker. This is the form they fill.
Call To Action Split
Block- Title
- Ready to move your reporting onto Acme?
- Description
Start with a workspace today and invite your team when you are ready — no migration project required.
- Assurance
- Free for 14 days. No card required.
- Links
- Start freedefaultTalk to salesoutline
- 1Add the block to a Page from the layout block picker.
- 2Fill the fields as above.
- 3Publish. RenderBlocks renders the block, fully typed.
Content model
title and description come from the shared call-to-action base at
src/blocks/shared/callToActionFields.ts, so editing them updates every installed call-to-action
block at once. assurance and links are specific to this variant.
The copy column stays left-aligned while the actions sit at the end of the row on large screens, so this variant suits a mid-page or footer prompt where a centered layout would break the reading line.
Prop
Type
Each item in links carries a link group with the standard Payload link fields (type, reference,
url, label, newTab, appearance). The first link renders as the default button and an
outline appearance renders as the secondary action.
What it installs
Composition
How the block hangs together in Payload
Pageslayout[]CallToActionSplittitledescriptionassurancelinks[] link
- Fields
src/blocks/CallToActionSplit/config.ts- Render
src/blocks/CallToActionSplit/Component.tsx
Files
Copies 3 files into your project. Files tagged shared are reused across the family.
Edits
Wires CallToActionSplit into the project in 4 places.
| Registers the block | src/collections/Pages/index.ts |
| Maps the renderer | src/blocks/RenderBlocks.tsx |
| Regenerates types | src/payload-types.ts |
| Regenerates the admin import map | src/app/(payload)/admin/importMap.js |
- Registers the block
src/collections/Pages/index.ts - Maps the renderer
src/blocks/RenderBlocks.tsx - Regenerates types
src/payload-types.ts - Regenerates the admin import map
src/app/(payload)/admin/importMap.js
callToActionFields.ts is shared source for this component family. Components that install the same path reuse your local copy, and re-running an install never overwrites a copy you have changed.Re-running the install detects existing source and wiring, then records install state in .payload-components/state.json.
Requirements
- Target
- payload-website-starter, payload-blocks-app
- Payload
- v3 (3.25 or newer) / v4 (experimental)
- Next.js
- 15 / 16 with v316 (16.4 or newer) with v4
- shadcn UI
- None
Payload v4 support is experimental: it needs Next.js 16 (16.4 or newer) and Node.js 24.22.1 or newer. Payload v3 (3.25 or newer) stays fully supported.
Your project must already expose components.json, src/payload.config.ts, the surfaces patched by payload-components add. The CLI verifies this against the support matrix before touching anything.