Eugene-Stone

payload html editor

by Eugene-Stone
Rich text & editors
v3
^3.90.2
MIT

Overview

Summary generated from the README

Adds an HTML editor field to Payload 3 that stores content as an HTML string instead of editor-specific JSON. It registers through a plugin that sets a default upload collection, and a field helper that you place in collections or globals. Tiptap packages are peer dependencies, and the admin import map must be regenerated after adding the field. The package does not sanitize HTML for public display.

Features

  • Toolbar-based visual editing with headings, lists, links and text formatting
  • Table editing and text alignment controls
  • Image insertion from a Payload upload collection or direct upload with a size limit
  • Optional HTML source editing modal
  • Per-field switches to turn images, tables, alignment and source editing on or off
  • Supports localized fields and a per-field media collection override

Use cases

  • Edit existing HTML-based content in Payload with a familiar WYSIWYG toolbar
  • Store rich content as HTML for frontends or systems that consume HTML directly
  • Give editors a simpler editor with only the features enabled per field

From the author

A Payload CMS 3 WYSIWYG field for editing HTML with Tiptap, rich-text tools, tables, and media.

Installation

npm i payload-html-editor

0

Stars

0

Forks

0

Open Issues

5 days ago

Last Updated

222

Weekly Downloads

v0.1.6

npm Version

72.2 KB

Unpacked Size

0

Dependencies

GitHub stars

00 since Oct 4

Show data
GitHub stars by day (UTC)
DateStars
Dec 5, 20260
Dec 4, 20260
Dec 3, 20260
Dec 2, 20260
Dec 1, 20260
Nov 30, 20260
Nov 29, 20260
Nov 28, 20260
Nov 27, 20260
Nov 26, 20260
Nov 25, 20260
Nov 24, 20260
Nov 23, 20260
Nov 22, 20260
Nov 21, 20260
Nov 20, 20260
Nov 19, 20260
Nov 18, 20260
Nov 17, 20260
Nov 16, 20260
Nov 15, 20260
Nov 14, 20260
Nov 13, 20260
Nov 12, 20260
Nov 11, 20260
Nov 10, 20260
Nov 9, 20260
Nov 8, 20260
Nov 7, 20260
Nov 6, 20260
Nov 5, 20260
Nov 4, 20260
Nov 3, 20260
Nov 2, 20260
Nov 1, 20260
Oct 31, 20260
Oct 30, 20260
Oct 29, 20260
Oct 28, 20260
Oct 27, 20260
Oct 26, 20260
Oct 25, 20260
Oct 24, 20260
Oct 23, 20260
Oct 22, 20260
Oct 21, 20260
Oct 20, 20260
Oct 19, 20260
Oct 18, 20260
Oct 17, 20260
Oct 16, 20260
Oct 15, 20260
Oct 14, 20260
Oct 13, 20260
Oct 12, 20260
Oct 11, 20260
Oct 10, 20260
Oct 9, 20260
Oct 8, 20260
Oct 7, 20260
Oct 6, 20260
Oct 5, 20260
Oct 4, 20260
npm weekly downloads

212−245 since Oct 12

Show data
npm weekly downloads by day (UTC)
DateWeekly downloads
Dec 5, 2026212
Dec 4, 2026197
Dec 3, 2026195
Dec 2, 202638
Dec 1, 202644
Nov 30, 202669
Nov 29, 2026156
Nov 28, 2026155
Nov 27, 2026156
Nov 26, 2026153
Nov 25, 2026142
Nov 24, 2026135
Nov 23, 2026105
Nov 22, 20267
Nov 21, 20268
Nov 20, 202616
Nov 19, 202617
Nov 18, 202621
Nov 17, 202627
Nov 16, 202631
Nov 15, 202633
Nov 14, 202633
Nov 13, 202627
Nov 12, 202633
Nov 11, 202630
Nov 10, 202624
Nov 9, 202620
Nov 8, 202619
Nov 7, 202627
Nov 6, 202623
Nov 5, 202617
Nov 4, 202614
Nov 3, 202618
Nov 2, 202623
Nov 1, 202622
Oct 31, 202613
Oct 30, 202615
Oct 29, 202614
Oct 28, 202614
Oct 27, 202619
Oct 26, 202622
Oct 25, 202634
Oct 24, 202644
Oct 23, 202641
Oct 22, 202685
Oct 21, 2026387
Oct 20, 2026414
Oct 19, 2026440
Oct 18, 2026883
Oct 17, 2026873
Oct 16, 2026873
Oct 15, 2026829
Oct 14, 2026527
Oct 13, 2026491
Oct 12, 2026457

Each point is npm's rolling 7-day download count.

Health Score

75/100Excellent

Composite score based on GitHub activity, stars, npm downloads, publish recency, dependency count, and package size.

Badge for your README

Payload Directory health badge
Markdown
[![Payload Directory](https://payloaddirectory.dev/badge/1411796536-root.svg)](https://payloaddirectory.dev/plugins/1411796536-root)
HTML
<a href="https://payloaddirectory.dev/plugins/1411796536-root"><img src="https://payloaddirectory.dev/badge/1411796536-root.svg" alt="Payload Directory"></a>
Updated Nov 30, 2026Created Oct 9, 2026Published Nov 30, 2026

README

Payload HTML Editor

A visual HTML editor field for Payload CMS 3, powered by Tiptap.

Give content editors a familiar toolbar-based WYSIWYG workflow, similar in spirit to the classic WordPress editor or CKEditor, while saving content as an HTML string—not editor-specific JSON. It’s a good fit for projects that need to work with existing HTML, render content on the frontend, or integrate with HTML-based systems.

This is an independent editor, not a WordPress or CKEditor clone, and is not affiliated with either project.

Demo

Watch the demo

Why use it?

  • HTML in, HTML out. The field stores an HTML string, which can fit existing HTML-based content and rendering pipelines.
  • Native Payload field. Uses a normal textarea field and Payload's admin field component system.
  • Familiar editing tools. Format text, create headings and lists, align text, add links, and edit tables.
  • Payload media integration. Select images from a Payload upload collection or upload them from the editor.
  • Optional HTML source editor. Inspect and edit source when visual editing is not enough.
  • Choose your features. Turn images, tables, alignment, and source editing on or off per field.

Install

npm install payload-html-editor

Peer dependencies

This package uses Payload, React, and Tiptap packages provided by your application. With npm 7 or later, npm installs peer dependencies automatically by default. If your project sets legacy-peer-deps=true in .npmrc, npm skips that automatic installation. Remove that setting or install the Tiptap packages explicitly:

npm install \
  @tiptap/core@^3.31.4 \
  @tiptap/extension-file-handler@^3.31.4 \
  @tiptap/extension-image@^3.31.4 \
  @tiptap/extension-table@^3.31.4 \
  @tiptap/extension-text-align@^3.31.4 \
  @tiptap/react@^3.31.4 \
  @tiptap/starter-kit@^3.31.4

Payload, @payloadcms/ui, React, and React DOM are also declared as peer dependencies. A Payload application normally already has these installed.

The editor component imports its styles. If your application needs a direct CSS import, include this in your admin bundle:

import 'payload-html-editor/styles.css'

Quick start

Add the plugin to your Payload config. Set mediaCollection to the slug of your Payload upload collection:

import { buildConfig } from 'payload'
import { htmlEditorPlugin } from 'payload-html-editor'

export default buildConfig({
  plugins: [
    htmlEditorPlugin({
      mediaCollection: 'media',
    }),
  ],
})

Use the field in a collection or global:

import type { CollectionConfig } from 'payload'
import { htmlEditorField } from 'payload-html-editor'

export const Pages: CollectionConfig = {
  slug: 'pages',
  fields: [
    htmlEditorField({
      name: 'content',
      label: 'Content',
    }),
  ],
}

Regenerate Payload's admin import map after adding or changing the field:

npx payload generate:importmap

Features and options

All editor features are enabled by default. Disable individual features for a field:

htmlEditorField({
  name: 'summary',
  features: {
    images: false,
    tables: false,
    sourceEditing: false,
    textAlignment: true,
  },
})

Enable Payload localization per field with localized: true:

htmlEditorField({
  name: 'content',
  localized: true,
})

Set localized: false (the default) to keep the value shared across locales.

The plugin's mediaCollection is the default for every editor field. A field can override it:

htmlEditorField({
  name: 'content',
  mediaCollection: 'assets',
  maxUploadSize: 5 * 1024 * 1024,
})
OptionTypeDefaultDescription
namestringRequiredPayload field name
labelstringField nameAdmin field label
requiredbooleanfalseWhether the field is required
localizedbooleanfalseWhether the field has a separate value for each configured locale
mediaCollectionstringPlugin setting or mediaUpload collection used for image selection and upload
maxUploadSizenumber10 MBMaximum image upload size in bytes
features.imagesbooleantrueImage insertion, upload, and media library
features.tablesbooleantrueTable editing controls
features.sourceEditingbooleantrueHTML source modal
features.textAlignmentbooleantrueText alignment controls
adminTextareaField['admin']—Additional Payload admin field configuration
componentPathstringpayload-html-editor/client#HtmlEditorCustom admin field component path

Disabled features are omitted from both the toolbar and the Tiptap extension list.

Media collection

Image upload and selection use Payload's REST API with the current admin user's credentials. Configure an upload collection and make sure its documents include:

  • id
  • url
  • Optional alt, filename, width, and height
  • Optional sizes with url and width for responsive srcset

Uploads are limited to JPEG, PNG, WebP, and GIF. Configure access on your collection as appropriate for your Payload users.

Is this a CKEditor or WordPress replacement?

It offers a comparable toolbar-based visual editing workflow for common rich-text tasks, but it is not feature-for-feature compatible with CKEditor or WordPress. It is designed specifically as a Payload CMS field, and Tiptap's schema determines which HTML elements and attributes can be represented.

Existing HTML may be a useful starting point when migrating, but test representative content before switching. WordPress block-editor comments/blocks and markup or editor-specific CKEditor data may need conversion. Unsupported tags and attributes can be removed when Tiptap parses and saves content.

Security

The source editor allows admins to enter HTML that Tiptap can parse through its configured schema. This package does not sanitize HTML for public display. Sanitize saved content at your application's output boundary according to your XSS policy, especially if content can be supplied by untrusted users.

Compatibility

The published package is developed and tested with:

  • Payload CMS 3.90.x
  • React 19.2.x
  • Tiptap 3.31.x
  • Node.js ^18.20.2 || >=20.9.0

Payload, React, and Tiptap are peer dependencies. Next.js is not required by the package itself, but is commonly used with Payload.

Development

npm install
npm run build
npm run pack:check

npm run pack:check builds the package and previews the files that would be published. Before opening a release, test the packed package in a Payload application.

License

MIT

Similar plugins