Installation
How to install a Payload Component into a supported Payload v3 project.
Payload Components currently targets Payload v3 projects using Next.js App Router and the supported website-style block layout shape.
Requirements
The installer verifies the target project shape before it mutates anything. If a requirement is missing, it stops rather than leaving a half-wired repo.
Your project must run these majors:
| Dependency | Version |
|---|---|
payload | v3 |
next | v15 or v16 |
…and it must already contain the website-style block layout the installer patches into:
Plus package.json scripts for generate:types and generate:importmap, which the CLI runs after wiring.
Install a component
Pick a component and run its add command from the root of your Payload project. The component pages show the exact command for every block; examples:
npx payload-components add hero-basicnpx payload-components add feature-grid-basicnpx payload-components add logo-cloud-gridnpx payload-components add content-columnsnpx payload-components add integration-gridWhat the CLI does
The wrapper CLI owns the Payload-specific work that direct registry installation cannot handle:
Validate the target project shape — refuse to touch a repo that isn't a supported Payload v3 + Next.js project.
Build or resolve the registry item and install source files through the shadcn registry flow.
Apply Payload layout and render fragments — register the block in RenderBlocks and the Pages layout field.
Install missing component dependencies so the block compiles in your project.
Run post-install scripts (generate:types, generate:importmap) and write .payload-components/state.json.
Doctor
Run a read-only health check before or after installing components:
npx payload-components doctordoctor validates the supported project shape, required post-install scripts,
and recorded component installs in .payload-components/state.json. It exits
non-zero when files, Payload fragments, dependency declarations, or install state
need attention.
Idempotency
Running the same install twice should not duplicate imports, block registrations, or layout entries. The installer verifies files, fragments, dependencies, and recorded state before deciding whether any work is needed.
Direct registry installs
Every block is also published to a public, shadcn-compatible registry, so you can pull a block's files with the plain shadcn CLI — useful for inspecting a block or dropping one into a non-Payload project.
Register the namespace once in your project's components.json:
{
"registries": {
"@payload-components": "https://www.payload-components.xyz/r/{name}.json"
}
}Then add any block by name:
pnpm dlx shadcn@latest add @payload-components/hero-basicOr install a single item straight from its URL, without configuring the namespace:
pnpm dlx shadcn@latest add https://www.payload-components.xyz/r/hero-basic.jsonA direct shadcn add only copies the block's source files and its shadcn UI
dependencies. It does not register the block in RenderBlocks, wire the
Pages layout field, install Payload dependencies, or run generate:types and
generate:importmap. For a real Payload project, use payload-components add —
it does all of that and records install state.
payload-components add vs shadcn add
Both install registry items; they differ in where they stop. shadcn add copies a component's files. payload-components add also registers, renders, types, and import-maps the Payload block.
Hero Basic
A headline-led marketing hero — eyebrow, title, supporting copy, CTAs, and proof badges — installed as a wired Payload block.