Page blocksStats

Stats Grid

Heading and intro above a responsive grid of large string metrics on rule-topped columns.

v0.2.0Page blockpayload-website-starter

import type { Block } from 'payload'

import { statsFields, statsMetricFields } from '@/blocks/shared/statsFields'

export const StatsGrid: Block = {
  slug: 'statsGrid',
  // Existing apps must migrate stored data before adopting this identifier:
  // https://www.payload-components.xyz/docs/registry#installed-source-and-migrations

Installation

npx payload-components add stats-grid
Manualnpx shadcn@latest add https://www.payload-components.xyz/r/stats-grid.json

The 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 Stats Grid from a Page layout's block picker. This is the form they fill.

Stats Grid

Block
Eyebrow
By the numbers
Title
Growth teams can measure.
Description

Every workspace reports the same governed metrics, so the numbers on this page are the numbers in the product.

Metrics
  1. 01
    Integrations90+
  2. 02
    Productivity boost56%
  3. 03
    Customer support24/7
  4. 04
    Active users10k+
  1. 1Add the block to a Page from the layout block picker.
  2. 2Fill the fields as above.
  3. 3Publish. RenderBlocks renders the block, fully typed.

Content model

eyebrow and title come from the shared statsFields base that every Stats variant spreads; description and metrics are specific to this variant. Metric values stay strings, so editors can enter percentages, signed values, counts, or abbreviated totals without formatting logic.

Prop

Type

Each item in metrics carries:

Prop

Type

What it installs

Composition

How the block hangs together in Payload

Pageslayout[]StatsGrideyebrowtitledescriptionmetrics[]valuelabel
Fields
src/blocks/StatsGrid/config.ts
Render
src/blocks/StatsGrid/Component.tsx

Files

Copies 3 files into your project. Files tagged shared are reused across the family.

statsFields.tsshared
config.ts
Component.tsx

Edits

Wires StatsGrid into the project in 4 places.

  • Registers the blocksrc/collections/Pages/index.ts
  • Maps the renderersrc/blocks/RenderBlocks.tsx
  • Regenerates typessrc/payload-types.ts
  • Regenerates the admin import mapsrc/app/(payload)/admin/importMap.js
statsFields.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
badge

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.


Layout adapted from tailark/blocks (MIT), retokenized onto the Payload Components design system.

In this family