payload-inplace
v0.2.5
Published
Live editing for Payload CMS websites with inline text, native fields, block reordering and reviewed drafts.
Maintainers
Readme
What you get
Your website is the editing surface. Keep its URL, header, footer and scroll position. Select a heading and type; use native Payload fields when the content needs more than inline text.
- Inline text and rich text with native field ownership, preserved styling and compact formatting controls.
- Media replacement and scoped settings for images, relationships, conditional fields and nested array items.
- Sections in context: one insertion point between blocks, searchable previews, drag-and-drop and keyboard reordering.
- Immediate feedback, reviewed publishing: optimistic rendering, debounced draft saves, changed-only comparisons and saved versions.
- Your schemas and rules: explicit bindings, existing Payload permissions/hooks and optional app-owned controls.
Real, synthetic commerce demo. Your application supplies the design; Payload Inplace supplies the editing layer. Open any image for its full-resolution capture.
See it in action
Replace media without leaving the page
Replace a document's image reference without rewriting shared asset metadata. Register the media picker →
Keep complex fields native
Select exactly one array item or a related group of fields. Payload retains conditions, validation and access. Map nested fields →
Add and organize sections
Preview an option before inserting it. Cancel without saving; insert with native defaults. Configure sections and previews →
Review what changed
Compare against the published document or the draft at session start. Publish the reviewed saved revision, then return to the website. Drafts, review and history →
The demo includes native shops and products schemas, a named-tab blocks root, price groups, media, conditional finishes and two nested arrays. Schema and renderer · Run locally
Quick start
Target: Payload 3.94.x + Next.js 16.4.6 App Router / Turbopack, React 19.3.x, Node 24+. This is an integration into your existing website, not an automatic page builder. You do not need Tailwind in your host to consume the package.
pnpm add payload-inplace @payloadcms/[email protected]Configure an existing draft-enabled blocks root:
import { visualEditor } from "payload-inplace";
import { postgresConcurrency } from "payload-inplace/postgres";
import { canEditWebsite } from "./access/canEditWebsite";
const editor = visualEditor({
collections: { pages: { roots: ["layout"] } },
previewOrigin: process.env.SITE_ORIGIN!,
resolvePagePath: ({ document }) =>
document.slug === "home" ? "/" : `/${document.slug}`,
canEdit: ({ req, document }) => canEditWebsite(req.user, document),
concurrency: postgresConcurrency(),
});
// Add editor to your existing buildConfig({ plugins: [...] }).canEditWebsite is your server-side policy, additional to Payload access. Apply the additive revision-field migration through your normal Payload workflow before serving the Postgres guard.
Bind the element that renders the field:
import { getBlockAttributes, getFieldAttributes } from 'payload-inplace/bindings'
const identity = { root: 'layout', blockId: block.id }
<section {...getBlockAttributes(identity, active)}>
<h1 {...getFieldAttributes({ ...identity, field: 'heading', edit: 'inline' }, active)}>
{block.heading}
</h1>
</section>active comes from your authorized render entry. Helpers are inert when inactive. Connect the server launcher, shared layout, internal active route, dedicated component map and native server-function bridge using the step-by-step getting-started guide. Every step names the host file, an executable reference and a check.
Documentation
| I want to… | Guide | | ---------------------------------- | --------------------------------------------------------------------------------------------------------------------- | | Get a working integration | Getting started | | Understand the editing flow | Screenshot tour | | Select every nested element | Bindings and terminal fields | | Edit native Lexical content inline | Rich text and styling | | Use the image library | Media selection | | Configure section hover previews | Sections and catalogue | | Customize tools or theme | Controls and CSS variables | | Understand saving and publication | Drafts and review | | Fix an integration problem | Troubleshooting |
Developer references: Host runtime contract · Public API · Architecture · Security/caching · Test kit · Release/upgrade · Contributing.
Compatibility
| Runtime | Tested contract | | ---------------------------------------------- | ------------------------------------------------------------------------- | | Payload / UI / Payload Next / database adapter | 3.94.0, aligned exact versions | | Next.js | 16.4.6, App Router, Turbopack | | React / React DOM | 19.3.x | | Node.js | 24+, release CI on Node 24 | | Database | Postgres for transactional concurrency; Mongo single-writer demo fallback |
Draft globals, finite document scopes and content localization are opt-in. Cross-origin frontends and editing custom Lexical node internals are outside the current contract. The native bridge is version-pinned; check compatibility before upgrading peers.
License
MIT. Independent of Payload CMS. Upstream attribution.
