Faq Split
A two-column FAQ pairing a sticky heading and CTA with an accordion list.
import type { Block } from 'payload'import { faqFields, faqItemsField } from '@/blocks/shared/faqFields'import { linkGroup } from '@/fields/linkGroup'export const FaqSplit: Block = { slug: 'faqSplit', interfaceName: 'FaqSplitBlock', fields: [ // Shared FAQ core (eyebrow, title, description). Variant-specific fields // follow; edit the shared shape in @/blocks/shared/faqFields. ...faqFields, faqItemsField, linkGroup({ overrides: { admin: { initCollapsed: true, }, maxRows: 1, }, }), ], labels: { plural: 'FAQ Split Blocks', singular: 'FAQ Split', },}import React from 'react'import type { FaqSplitBlock as FaqSplitBlockData } from '@/payload-types'import { CMSLink } from '@/components/Link'import { Accordion, AccordionContent, AccordionItem, AccordionTrigger,} from '@/components/ui/accordion'import { Badge } from '@/components/ui/badge'import { cn } from '@/utilities/ui'type Props = FaqSplitBlockData & { id?: string className?: string disableInnerContainer?: boolean}export const FaqSplitBlock: React.FC<Props> = ({ className, description, disableInnerContainer, eyebrow, id, items, 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('grid gap-10 md:grid-cols-5 md:gap-12', { 'mx-auto max-w-5xl': !disableInnerContainer, })} > <div className="flex flex-col gap-4 md:col-span-2"> {eyebrow ? ( <Badge variant="outline" className="w-fit rounded-full px-3 py-1 uppercase tracking-eyebrow"> {eyebrow} </Badge> ) : null} <h2 className="text-4xl font-medium tracking-display text-balance">{title}</h2> {description ? ( <p className="text-base leading-7 text-muted-foreground">{description}</p> ) : null} {links && links.length > 0 ? ( <div className="flex flex-col gap-3 sm:flex-row"> {links.map(({ link }, index) => ( <CMSLink key={index} appearance={link.appearance === 'outline' ? 'outline' : 'default'} {...link} /> ))} </div> ) : null} </div> {items && items.length > 0 ? ( <Accordion type="single" collapsible className="w-full md:col-span-3"> {items.map((item, index) => ( <AccordionItem key={item.id ?? `${item.question}-${index}`} value={item.id ?? `item-${index}`} className="border-border/70" > <AccordionTrigger className="text-left text-base tracking-title hover:no-underline"> {item.question} </AccordionTrigger> <AccordionContent className="text-sm leading-7 text-muted-foreground"> {item.answer} </AccordionContent> </AccordionItem> ))} </Accordion> ) : null} </div> </div> </section> )}import type { Field } from 'payload'/** * Shared field core for the FAQ component family. * * Every FAQ variant (faq-accordion, faq-split, faq-card, faq-icons, * faq-grouped, faq-grid) spreads these section-heading fields first and then * appends its own variant-specific shape — the question/answer items, which * differ per layout (flat list, icon-tagged, or grouped). Editing the shared * eyebrow/title/description here updates every installed FAQ block at once, so * the family never drifts field-by-field across a repo. * * Installed once per repo at `src/blocks/shared/faqFields.ts`; re-running * `payload-components add faq-*` never overwrites a copy you have already edited. */export const faqFields: Field[] = [ { name: 'eyebrow', type: 'text', }, { name: 'title', type: 'text', required: true, }, { name: 'description', type: 'textarea', },]/** * Reusable question/answer array for the plain FAQ variants (faq-accordion, * faq-split, faq-card, faq-grid). The icon and grouped variants define their * own item shape, so they compose `faqFields` but not this field. */export const faqItemsField: Field = { name: 'items', type: 'array', required: true, minRows: 1, admin: { initCollapsed: true, }, fields: [ { name: 'question', type: 'text', required: true, }, { name: 'answer', type: 'textarea', required: true, }, ],}Installation
npx payload-components add faq-splitCopy the files straight from the registry, then wire the Payload fragments by hand:
pnpm dlx shadcn@latest add https://www.payload-components.xyz/r/faq-split.jsonWhat it installs
Copies 3 source files into your project:
src/blocks/shared/faqFields.tssharedsrc/blocks/FaqSplit/config.tssrc/blocks/FaqSplit/Component.tsx
…and makes 4 edits to wire the block into your project:
| 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 |
faqFields.ts is the shared field core for this family — every variant composes it. Editing it updates each installed block at once, and re-running an install never overwrites a copy you have changed.Re-running the install converges: it detects existing wiring, skips it, and records install state in .payload-components/state.json.
Content model
The first three fields come from the shared faqFields base; items and links are specific
to this variant.
Prop
Type
Each item in items carries:
Prop
Type
Usage
FaqSplit block to its layout.RenderBlocks on the frontend, fully typed — no extra wiring.Requirements
- Target
- payload-website-starter
- Payload
- v3
- Next.js
- 15 / 16
- shadcn UI
- accordion, badge
Your project must already expose components.json, src/payload.config.ts, src/blocks/RenderBlocks.tsx, src/collections/Pages/index.ts — the surfaces payload-components add patches. The CLI verifies this against the support matrix before touching anything.
In this family
faq-accordionfaq-splitcurrentfaq-cardfaq-iconsfaq-groupedfaq-grid