Adds a frontend toolbar that lets editors click CMS-managed text on a draft page to edit, save a draft or publish without opening the admin panel. The plugin adds a virtual source map field to configured collections, and a helper turns it into attributes for your elements. An annotation mode places numbered markers with comments and can export markdown or send events to a webhook. Requires draft mode on the collections.
A Payload CMS plugin for inline editing and visual feedback.
Installation
npm i payloadcms-visual-editor18
Stars
1
Forks
6
Open Issues
4 days ago
Last Updated
79
Weekly Downloads
v0.0.2
npm Version
1.0 MB
Unpacked Size
0
Dependencies
18+6 since Sep 7
| Date | Stars |
|---|---|
| Dec 6, 2026 | 18 |
| Dec 5, 2026 | 18 |
| Dec 4, 2026 | 18 |
| Dec 3, 2026 | 18 |
| Dec 2, 2026 | 18 |
| Dec 1, 2026 | 18 |
| Nov 30, 2026 | 18 |
| Nov 29, 2026 | 18 |
| Nov 28, 2026 | 18 |
| Nov 27, 2026 | 18 |
| Nov 26, 2026 | 18 |
| Nov 25, 2026 | 18 |
| Nov 24, 2026 | 18 |
| Nov 23, 2026 | 18 |
| Nov 22, 2026 | 18 |
| Nov 21, 2026 | 18 |
| Nov 20, 2026 | 18 |
| Nov 19, 2026 | 18 |
| Nov 18, 2026 | 18 |
| Nov 17, 2026 | 18 |
| Nov 16, 2026 | 18 |
| Nov 15, 2026 | 18 |
| Nov 14, 2026 | 18 |
| Nov 13, 2026 | 18 |
| Nov 12, 2026 | 18 |
| Nov 11, 2026 | 18 |
| Nov 10, 2026 | 18 |
| Nov 9, 2026 | 17 |
| Nov 8, 2026 | 18 |
| Nov 7, 2026 | 18 |
| Nov 6, 2026 | 18 |
| Nov 5, 2026 | 18 |
| Nov 4, 2026 | 18 |
| Nov 3, 2026 | 18 |
| Nov 2, 2026 | 18 |
| Nov 1, 2026 | 18 |
| Oct 31, 2026 | 18 |
| Oct 30, 2026 | 18 |
| Oct 29, 2026 | 18 |
| Oct 28, 2026 | 17 |
| Oct 27, 2026 | 17 |
| Oct 26, 2026 | 17 |
| Oct 25, 2026 | 17 |
| Oct 24, 2026 | 17 |
| Oct 23, 2026 | 17 |
| Oct 22, 2026 | 17 |
| Oct 21, 2026 | 16 |
| Oct 20, 2026 | 16 |
| Oct 19, 2026 | 16 |
| Oct 18, 2026 | 16 |
| Oct 17, 2026 | 16 |
| Oct 16, 2026 | 16 |
| Oct 15, 2026 | 16 |
| Oct 14, 2026 | 15 |
| Oct 13, 2026 | 15 |
| Oct 12, 2026 | 15 |
| Oct 11, 2026 | 15 |
| Oct 10, 2026 | 15 |
| Oct 9, 2026 | 15 |
| Oct 8, 2026 | 15 |
| Oct 7, 2026 | 15 |
| Oct 6, 2026 | 15 |
| Oct 5, 2026 | 14 |
| Oct 4, 2026 | 14 |
| Oct 3, 2026 | 14 |
| Oct 2, 2026 | 14 |
| Oct 1, 2026 | 14 |
| Sep 30, 2026 | 14 |
| Sep 29, 2026 | 13 |
| Sep 28, 2026 | 13 |
| Sep 27, 2026 | 13 |
| Sep 26, 2026 | 13 |
| Sep 25, 2026 | 13 |
| Sep 24, 2026 | 13 |
| Sep 23, 2026 | 13 |
| Sep 22, 2026 | 13 |
| Sep 21, 2026 | 13 |
| Sep 20, 2026 | 13 |
| Sep 19, 2026 | 13 |
| Sep 18, 2026 | 13 |
| Sep 17, 2026 | 13 |
| Sep 16, 2026 | 12 |
| Sep 15, 2026 | 12 |
| Sep 14, 2026 | 12 |
| Sep 13, 2026 | 12 |
| Sep 12, 2026 | 12 |
| Sep 11, 2026 | 12 |
| Sep 10, 2026 | 12 |
| Sep 9, 2026 | 12 |
| Sep 8, 2026 | 12 |
| Sep 7, 2026 | 12 |
59+41 since Sep 7
| Date | Weekly downloads |
|---|---|
| Dec 6, 2026 | 59 |
| Dec 5, 2026 | 36 |
| Dec 4, 2026 | 36 |
| Dec 3, 2026 | 30 |
| Dec 2, 2026 | 27 |
| Dec 1, 2026 | 39 |
| Nov 30, 2026 | 51 |
| Nov 29, 2026 | 71 |
| Nov 28, 2026 | 83 |
| Nov 27, 2026 | 102 |
| Nov 26, 2026 | 97 |
| Nov 25, 2026 | 102 |
| Nov 24, 2026 | 95 |
| Nov 23, 2026 | 90 |
| Nov 22, 2026 | 92 |
| Nov 21, 2026 | 99 |
| Nov 20, 2026 | 102 |
| Nov 19, 2026 | 119 |
| Nov 18, 2026 | 117 |
| Nov 17, 2026 | 112 |
| Nov 16, 2026 | 105 |
| Nov 15, 2026 | 91 |
| Nov 14, 2026 | 96 |
| Nov 13, 2026 | 84 |
| Nov 12, 2026 | 71 |
| Nov 11, 2026 | 63 |
| Nov 10, 2026 | 65 |
| Nov 9, 2026 | 66 |
| Nov 8, 2026 | 60 |
| Nov 7, 2026 | 40 |
| Nov 6, 2026 | 33 |
| Nov 5, 2026 | 28 |
| Nov 4, 2026 | 27 |
| Nov 3, 2026 | 25 |
| Nov 2, 2026 | 26 |
| Nov 1, 2026 | 26 |
| Oct 31, 2026 | 27 |
| Oct 30, 2026 | 25 |
| Oct 29, 2026 | 20 |
| Oct 28, 2026 | 16 |
| Oct 27, 2026 | 16 |
| Oct 26, 2026 | 15 |
| Oct 25, 2026 | 15 |
| Oct 24, 2026 | 19 |
| Oct 23, 2026 | 15 |
| Oct 22, 2026 | 28 |
| Oct 21, 2026 | 36 |
| Oct 20, 2026 | 36 |
| Oct 19, 2026 | 34 |
| Oct 18, 2026 | 35 |
| Oct 17, 2026 | 30 |
| Oct 16, 2026 | 35 |
| Oct 15, 2026 | 24 |
| Oct 14, 2026 | 18 |
| Oct 13, 2026 | 18 |
| Oct 12, 2026 | 19 |
| Oct 11, 2026 | 20 |
| Oct 10, 2026 | 37 |
| Oct 9, 2026 | 35 |
| Oct 8, 2026 | 93 |
| Oct 7, 2026 | 95 |
| Oct 6, 2026 | 98 |
| Oct 5, 2026 | 98 |
| Oct 4, 2026 | 94 |
| Oct 3, 2026 | 76 |
| Oct 2, 2026 | 76 |
| Oct 1, 2026 | 18 |
| Sep 30, 2026 | 15 |
| Sep 29, 2026 | 12 |
| Sep 28, 2026 | 12 |
| Sep 27, 2026 | 13 |
| Sep 26, 2026 | 15 |
| Sep 25, 2026 | 13 |
| Sep 24, 2026 | 16 |
| Sep 23, 2026 | 23 |
| Sep 22, 2026 | 25 |
| Sep 21, 2026 | 25 |
| Sep 20, 2026 | 25 |
| Sep 19, 2026 | 22 |
| Sep 18, 2026 | 22 |
| Sep 17, 2026 | 19 |
| Sep 16, 2026 | 14 |
| Sep 15, 2026 | 13 |
| Sep 14, 2026 | 15 |
| Sep 13, 2026 | 14 |
| Sep 12, 2026 | 13 |
| Sep 11, 2026 | 16 |
| Sep 10, 2026 | 15 |
| Sep 9, 2026 | 16 |
| Sep 8, 2026 | 15 |
| Sep 7, 2026 | 18 |
Each point is npm's rolling 7-day download count.
Health Score
Composite score based on GitHub activity, stars, npm downloads, publish recency, dependency count, and package size.
Badge for your README
[](https://payloaddirectory.dev/plugins/1213841375-root)<a href="https://payloaddirectory.dev/plugins/1213841375-root"><img src="https://payloaddirectory.dev/badge/1213841375-root.svg" alt="Payload Directory"></a>README
Edit CMS content directly on your live pages. Annotate everything else.
Payload Visual Editor eliminates the round-trip between your frontend and the admin panel. Content editors click and edit text fields right where they appear on the page. For elements that live in code (layout, styling, components), switch to annotation mode — place visual markers with comments and send the feedback to your developers, GitHub issues, or an AI agent via webhooks.
Cmd+Shift+F to toggle)npm install payloadcms-visual-editor
# or
pnpm add payloadcms-visual-editor
# or
yarn add payloadcms-visual-editor
Note: The visual editor requires Payload's draft mode to be enabled. When fetching documents, pass
contentSourceMap: truein the querycontextto populate the_sourceMapfield.
// payload.config.ts
import { payloadVisualEditor } from 'payloadcms-visual-editor'
export default buildConfig({
plugins: [
payloadVisualEditor({
collections: {
pages: true,
posts: true,
},
}),
],
})
Use the createEditableAttrs helper to extract editable paths from the _sourceMap field, then spread the attributes on your elements.
// app/(frontend)/[slug]/page.tsx
import { getPayload } from 'payload'
import { createEditableAttrs } from 'payloadcms-visual-editor'
export default async function Page({ params }) {
const payload = await getPayload({ config: configPromise })
const pageResult = await payload.find({
collection: 'pages',
context: {
contentSourceMap: true,
},
draft: true,
limit: 1,
})
const page = pageResult.docs[0]
const editable = createEditableAttrs(page._sourceMap)
return (
<main>
<h1 {...editable('title')}>{page.title}</h1>
<p {...editable('description')}>{page.description}</p>
</main>
)
}
import { VisualEditorToolbar } from 'payloadcms-visual-editor/client'
{
draft && page._sourceMap ? (
<VisualEditorToolbar
documentInfo={{
id: page.id,
collection: 'pages',
hasDrafts: true,
}}
/>
) : null
}
Visit any draft page on your frontend. The toolbar appears at the bottom of the viewport. Click any editable element to edit it inline, or switch to annotation mode to leave visual feedback.
payloadVisualEditor({
collections: {
// Keys are collection slugs, values enable the plugin for that collection
pages: true,
posts: true,
},
// Set to true to disable the plugin without removing it from config
disabled: false,
})
Required:
| Prop | Type | Description |
|---|---|---|
documentInfo | { id: string | number; collection: string; hasDrafts: boolean } | Payload CMS document metadata for the current page |
Optional:
| Prop | Type | Default | Description |
|---|---|---|---|
className | string | - | Custom class applied to the toolbar container |
copyToClipboard | boolean | true | Copy markdown output to clipboard when copy button is clicked |
endpoint | string | - | Server URL for sync (e.g. "http://localhost:4747") |
sessionId | string | - | Pre-existing session ID to join |
webhookUrl | string | - | Webhook URL to receive annotation events |
enableDemoMode | boolean | false | Enable demo mode with sample annotations |
demoAnnotations | DemoAnnotation[] | - | Array of demo annotations to display |
demoDelay | number | 1000 | Delay in ms before showing demo annotations |
onAnnotationAdd | (annotation: Annotation) => void | - | Callback fired when an annotation is added |
onAnnotationDelete | (annotation: Annotation) => void | - | Callback fired when an annotation is deleted |
onAnnotationUpdate | (annotation: Annotation) => void | - | Callback fired when an annotation comment is edited |
onAnnotationsClear | (annotations: Annotation[]) => void | - | Callback fired when all annotations are cleared |
onCopy | (markdown: string) => void | - | Callback fired when copy button is clicked |
onSubmit | (output: string, annotations: Annotation[]) | - | Callback fired when "Send to Agent" is clicked |
onSessionCreated | (sessionId: string) => void | - | Called when a new session is created |
_sourceMap JSON field to each configured collectioncontentSourceMap — When you query a document with context: { contentSourceMap: true }, Payload populates the _sourceMap field with content-to-path mappingscreateEditableAttrs() — Extracts paths from _sourceMap and returns data-payload-path attributes to spread on your elementsVisualEditorToolbar reads these attributes to identify editable elements, enabling click-to-edit and annotation on your live pages┌─────────────────────────────────────────────────────────┐
│ Payload Query (contentSourceMap: true) │
│ ↓ │
│ _sourceMap field populated with content-to-path data │
│ ↓ │
│ createEditableAttrs() → data-payload-path attributes │
│ ↓ │
│ VisualEditorToolbar reads paths → enables editing │
└─────────────────────────────────────────────────────────┘
Clone the repo and install dependencies:
git clone https://github.com/<your-org>/payloadcms-visual-editor
cd payloadcms-visual-editor
pnpm install
Set up the dev environment:
cp dev/.env.example dev/.env
# Update DATABASE_URL and PAYLOAD_SECRET in dev/.env
Start the dev server:
pnpm dev
Visit http://localhost:3000 to see the demo app.
pnpm test # Run integration + e2e tests
pnpm test:int # Integration tests only
pnpm test:e2e # E2E tests only
pnpm lint # Lint source files
pnpm lint:fix # Auto-fix lint issues
pnpm typecheck # Run TypeScript type checking
pnpm build # Build the package
This plugin is based on Agentation by Benji Taylor. The original project provides an annotation toolbar for visual feedback on web pages. This plugin adapts those concepts and integrates them with Payload CMS for inline content editing and draft-aware annotation workflows.
The dev server website design is based on Tailark's Mist component kit by Méschac Irung.
payload better editor
Side-by-side live-preview iframe with a sidebar for editing individual blocks in the Payload edit view
781.2k/wk119v3
payload plugin workflows
Code-defined editorial workflows with stages, actions, transitions and publish guards for editors and AI agents
73797/wk37v3
payload preview click
Click a block or field in Payload live preview to jump to it in the edit form
6913/wk0v3
payload inplace
Live inline editing for Payload-powered Next.js websites with block reordering and reviewed drafts
62175/wk6v3
plugin
On-page editing and draft preview links for Payload collections and globals on a Next.js frontend
6068/wk4v3 v4
plugin
Click-to-edit inline visual editing and block operations on top of Payload Live Preview
581.3k/wk13v3