
TutorialTechnology
Building Custom Blocks in Payload CMS 3: The Complete 2026 Guide
Prerequisites
This tutorial requires TypeScript, React 19, and basic Payload CMS 3 knowledge.
What Are Blocks?
Blocks are reusable, typed content units. Digi37 ships with 22+ blocks:
Content— Rich text with full formattingCode— Syntax-highlighted code snippetsBanner— Info/Warning/Error/Success calloutsMediaBlock— Image with basic/banner display modesGallery— Grid/Masonry/Carousel/Bento layoutsHtml— Custom HTML with height constraintsCTA— Call-to-action with button variantsStats— Animated number countersTimeline— Vertical timeline with milestones
Step 1: Schema Definition
1import type { Block } from 'payload'2 3export const PricingCard: Block = {4 slug: 'pricingCard',5 interfaceName: 'PricingCardBlock',6 fields: [7 { name: 'title', type: 'text', required: true },8 { name: 'price', type: 'number', required: true },9 { name: 'period', type: 'select', options: [10 { label: 'Monthly', value: 'month' },11 { label: 'Yearly', value: 'year' },12 ]},13 { name: 'features', type: 'array', fields: [14 { name: 'text', type: 'text', required: true },15 { name: 'included', type: 'checkbox', defaultValue: true },16 ]},17 ],18}Step 2: React Component
1import type { PricingCardBlock } from '@/payload-types'2 3export const PricingCard = ({ title, price, period, features }: PricingCardBlock) => (4 <div className="rounded-lg border p-6">5 <h3 className="text-xl font-bold">{title}</h3>6 <p className="text-3xl font-bold mt-2">7 ${price}<span className="text-sm">/{period}</span>8 </p>9 <ul className="mt-4 space-y-2">10 {features?.map((f, i) => (11 <li key={i}>{f.included ? '✅' : '❌'} {f.text}</li>12 ))}13 </ul>14 </div>15)Step 3: Register
Add to your collection's BlocksFeature array, then run npx payload generate:types.
Advanced Patterns
In Payload 3, blocks are React Server Components by default. This means you can use async/await, access the Payload API directly, and render with zero client JS.
Comments
Related Posts

TechnologyEngineering
1 min
Real benchmarks, D1 architecture, and a production deploymen…

Design
1 min
Spatial design, oklch() color systems, semantic motion, and …

Business
1 min
ROI analysis, migration strategy, and cost breakdown for ent…