Adds a Lexical-based rich text editor to Payload CMS 1.x through a plugin and a lexicalRichTextField helper for collection fields. The editor mirrors the Lexical playground and exposes a feature API for toggling or adding features. It requires Payload 1.6.32 or later and does not support 2.x. Content can be migrated to Payload core Lexical with a converter.
Lexical plugin for Payload CMS
Installation
npm i payload-plugin-lexical213
Stars
10
Forks
18
Open Issues
2 years ago
Last Updated
153
Weekly Downloads
v0.6.6
npm Version
2.1 MB
Unpacked Size
20
Dependencies
213+3 since Sep 6
| Date | Stars |
|---|---|
| Dec 5, 2026 | 213 |
| Dec 4, 2026 | 213 |
| Dec 3, 2026 | 213 |
| Dec 2, 2026 | 213 |
| Dec 1, 2026 | 213 |
| Nov 30, 2026 | 213 |
| Nov 29, 2026 | 213 |
| Nov 28, 2026 | 213 |
| Nov 27, 2026 | 213 |
| Nov 26, 2026 | 213 |
| Nov 25, 2026 | 213 |
| Nov 24, 2026 | 214 |
| Nov 23, 2026 | 214 |
| Nov 22, 2026 | 214 |
| Nov 21, 2026 | 214 |
| Nov 20, 2026 | 214 |
| Nov 19, 2026 | 214 |
| Nov 18, 2026 | 214 |
| Nov 17, 2026 | 214 |
| Nov 16, 2026 | 214 |
| Nov 15, 2026 | 214 |
| Nov 14, 2026 | 214 |
| Nov 13, 2026 | 214 |
| Nov 12, 2026 | 214 |
| Nov 11, 2026 | 214 |
| Nov 10, 2026 | 214 |
| Nov 9, 2026 | 214 |
| Nov 8, 2026 | 214 |
| Nov 7, 2026 | 214 |
| Nov 6, 2026 | 214 |
| Nov 5, 2026 | 214 |
| Nov 4, 2026 | 214 |
| Nov 3, 2026 | 214 |
| Nov 2, 2026 | 214 |
| Nov 1, 2026 | 214 |
| Oct 31, 2026 | 214 |
| Oct 30, 2026 | 214 |
| Oct 29, 2026 | 214 |
| Oct 28, 2026 | 214 |
| Oct 27, 2026 | 214 |
| Oct 26, 2026 | 214 |
| Oct 25, 2026 | 214 |
| Oct 24, 2026 | 214 |
| Oct 23, 2026 | 214 |
| Oct 22, 2026 | 214 |
| Oct 21, 2026 | 213 |
| Oct 20, 2026 | 213 |
| Oct 19, 2026 | 213 |
| Oct 18, 2026 | 213 |
| Oct 17, 2026 | 213 |
| Oct 16, 2026 | 213 |
| Oct 15, 2026 | 213 |
| Oct 14, 2026 | 213 |
| Oct 13, 2026 | 213 |
| Oct 12, 2026 | 213 |
| Oct 11, 2026 | 212 |
| Oct 10, 2026 | 212 |
| Oct 9, 2026 | 212 |
| Oct 8, 2026 | 212 |
| Oct 7, 2026 | 212 |
| Oct 6, 2026 | 212 |
| Oct 5, 2026 | 212 |
| Oct 4, 2026 | 211 |
| Oct 3, 2026 | 211 |
| Oct 2, 2026 | 211 |
| Oct 1, 2026 | 211 |
| Sep 30, 2026 | 211 |
| Sep 29, 2026 | 211 |
| Sep 28, 2026 | 211 |
| Sep 27, 2026 | 211 |
| Sep 26, 2026 | 211 |
| Sep 25, 2026 | 211 |
| Sep 24, 2026 | 211 |
| Sep 23, 2026 | 211 |
| Sep 22, 2026 | 211 |
| Sep 21, 2026 | 211 |
| Sep 20, 2026 | 211 |
| Sep 19, 2026 | 211 |
| Sep 18, 2026 | 211 |
| Sep 17, 2026 | 211 |
| Sep 16, 2026 | 211 |
| Sep 15, 2026 | 211 |
| Sep 14, 2026 | 211 |
| Sep 13, 2026 | 210 |
| Sep 12, 2026 | 210 |
| Sep 11, 2026 | 210 |
| Sep 10, 2026 | 210 |
| Sep 9, 2026 | 210 |
| Sep 8, 2026 | 210 |
| Sep 7, 2026 | 210 |
| Sep 6, 2026 | 210 |
160+138 since Sep 6
| Date | Weekly downloads |
|---|---|
| Dec 5, 2026 | 160 |
| Dec 4, 2026 | 78 |
| Dec 3, 2026 | 83 |
| Dec 2, 2026 | 75 |
| Dec 1, 2026 | 67 |
| Nov 30, 2026 | 69 |
| Nov 29, 2026 | 110 |
| Nov 28, 2026 | 99 |
| Nov 27, 2026 | 85 |
| Nov 26, 2026 | 78 |
| Nov 25, 2026 | 85 |
| Nov 24, 2026 | 88 |
| Nov 23, 2026 | 85 |
| Nov 22, 2026 | 51 |
| Nov 21, 2026 | 61 |
| Nov 20, 2026 | 66 |
| Nov 19, 2026 | 68 |
| Nov 18, 2026 | 64 |
| Nov 17, 2026 | 60 |
| Nov 16, 2026 | 63 |
| Nov 15, 2026 | 84 |
| Nov 14, 2026 | 89 |
| Nov 13, 2026 | 91 |
| Nov 12, 2026 | 101 |
| Nov 11, 2026 | 108 |
| Nov 10, 2026 | 114 |
| Nov 9, 2026 | 112 |
| Nov 8, 2026 | 77 |
| Nov 7, 2026 | 65 |
| Nov 6, 2026 | 66 |
| Nov 5, 2026 | 63 |
| Nov 4, 2026 | 63 |
| Nov 3, 2026 | 58 |
| Nov 2, 2026 | 56 |
| Nov 1, 2026 | 65 |
| Oct 31, 2026 | 62 |
| Oct 30, 2026 | 51 |
| Oct 29, 2026 | 38 |
| Oct 28, 2026 | 25 |
| Oct 27, 2026 | 55 |
| Oct 26, 2026 | 55 |
| Oct 25, 2026 | 53 |
| Oct 24, 2026 | 52 |
| Oct 23, 2026 | 50 |
| Oct 22, 2026 | 60 |
| Oct 21, 2026 | 127 |
| Oct 20, 2026 | 104 |
| Oct 19, 2026 | 110 |
| Oct 18, 2026 | 115 |
| Oct 17, 2026 | 115 |
| Oct 16, 2026 | 118 |
| Oct 15, 2026 | 117 |
| Oct 14, 2026 | 97 |
| Oct 13, 2026 | 89 |
| Oct 12, 2026 | 80 |
| Oct 11, 2026 | 73 |
| Oct 10, 2026 | 76 |
| Oct 9, 2026 | 77 |
| Oct 8, 2026 | 74 |
| Oct 7, 2026 | 34 |
| Oct 6, 2026 | 34 |
| Oct 5, 2026 | 36 |
| Oct 4, 2026 | 41 |
| Oct 3, 2026 | 54 |
| Oct 2, 2026 | 61 |
| Oct 1, 2026 | 62 |
| Sep 30, 2026 | 65 |
| Sep 29, 2026 | 110 |
| Sep 28, 2026 | 109 |
| Sep 27, 2026 | 103 |
| Sep 26, 2026 | 88 |
| Sep 25, 2026 | 79 |
| Sep 24, 2026 | 73 |
| Sep 23, 2026 | 68 |
| Sep 22, 2026 | 74 |
| Sep 21, 2026 | 73 |
| Sep 20, 2026 | 71 |
| Sep 19, 2026 | 68 |
| Sep 18, 2026 | 67 |
| Sep 17, 2026 | 69 |
| Sep 16, 2026 | 66 |
| Sep 15, 2026 | 14 |
| Sep 14, 2026 | 16 |
| Sep 13, 2026 | 18 |
| Sep 12, 2026 | 18 |
| Sep 11, 2026 | 22 |
| Sep 10, 2026 | 24 |
| Sep 9, 2026 | 25 |
| Sep 8, 2026 | 23 |
| Sep 7, 2026 | 26 |
| Sep 6, 2026 | 22 |
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/570326999-root)<a href="https://payloaddirectory.dev/plugins/570326999-root"><img src="https://payloaddirectory.dev/badge/570326999-root.svg" alt="Payload Directory"></a>README
A plugin for Payload CMS whichs adds a lexical-based richtext editor. Lexical is a lot nicer to use than Slate & more modern - it's also maintained by Meta.
This plugin only supports payload 1.x - not 2.x. While this plugin can still be used if you need extra features (tables, color picker, collapsibles etc. etc.), it will not receive further development or support. This plugin is also a great reference for building new Features in the new Lexical editor in Payload core 2.0. It has the same features as the lexical playground, but its API is closer to the new Lexical Payload 2.0 API (which was inspired by this plugin), which makes porting over Features easier.
Note: This plugin and the new lexical in Payload 2.0 Lexical is powering the next richtext editor in Payload 2.0 (I'm calling it Lexical core here). Future development is focused on the new lexical editor rather than the older Slate-based editor.
There is a converter you can use to migrate everything from this plugin to the new lexical core. You can find more info about it here: https://payloadcms.com/docs/rich-text/lexical#migrating-from-payload-plugin-lexical
Please note that this migrator only migrates data, not features. While lexical core is more stable and carefully crafted than this plugin, this plugin still has more features which lexical core does not have - for example tables or collapsibles.
If you use these features, the data can be migrated over, but it will not be displayed inside the core lexical editor until you migrate the Feature over from this plugin to lexical core as well.
Lexical 2.0 core will eventually get all the missing features, and thus the missing converters. The main focus right now is stability
This plugin already comes packed with a ton of features which the original 1.0 Slate editor doesn't have (from tables & markdown to stuff like speech-to-tech) - all customizable. It's also a lot easier to extend this editor and add new stuff to it!
Install the plugin using yarn add payload-plugin-lexical. You can find examples of how to use it below.
Minimum required payload version: 1.6.32


payload.config.ts:
import { buildConfig } from 'payload/config';
import { LexicalPlugin } from "payload-plugin-lexical";
export default buildConfig({
...
plugins: [
LexicalPlugin({
// Only set this if you want to use the the AISuggest Feature
ai: {
openai_key: process.env.OPENAI_KEY,
},
}),
],
typescript: {
outputFile: path.resolve(__dirname, 'payload-types.ts'),
},
});
Collection config:
import { CollectionConfig } from 'payload/types';
import { lexicalRichTextField } from 'payload-plugin-lexical';
const Lexical: CollectionConfig = {
slug: 'lexicalRichText',
admin: {
useAsTitle: 'title',
},
fields: [
{
name: 'title',
type: 'text',
required: true,
},
lexicalRichTextField({
name: 'lexicalRichTextEditor',
label: 'Lexical Rich Text Editor',
}),
],
};
export default Lexical;
import { CollectionConfig } from 'payload/types';
import {
lexicalRichTextField,
EquationsFeature,
EmojisFeature,
EmojiPickerFeature,
HorizontalRuleFeature,
FigmaFeature,
YouTubeFeature,
TwitterFeature,
SpeechToTextFeature,
ImportFeature,
ExportFeature,
ClearEditorFeature,
ReadOnlyModeFeature,
ConvertFromMarkdownFeature,
MentionsFeature,
TreeViewFeature,
KeywordsFeature,
AutoCompleteFeature,
CollapsibleFeature,
TypingPerfFeature,
PasteLogFeature,
TestRecorderFeature,
LinkFeature,
TableOfContentsFeature,
AISuggestFeature,
} from 'payload-plugin-lexical';
const Lexical: CollectionConfig = {
slug: 'lexicalRichText',
admin: {
useAsTitle: 'title',
},
fields: [
{
name: 'title',
type: 'text',
required: true,
},
lexicalRichTextField({
name: 'lexicalRichTextEditor',
label: 'cool richtext editor',
localized: true,
editorConfigModifier: (defaultEditorConfig) => {
defaultEditorConfig.debug = false;
defaultEditorConfig.toggles.textColor.enabled = false;
defaultEditorConfig.toggles.textBackground.enabled = false;
defaultEditorConfig.toggles.fontSize.enabled = false;
defaultEditorConfig.toggles.font.enabled = false;
defaultEditorConfig.toggles.align.enabled = false;
defaultEditorConfig.toggles.tables.enabled = true;
defaultEditorConfig.toggles.tables.display = false;
// Optional: these are the default features. Feel free to customize them or remove the ones you do not like!
defaultEditorConfig.features = [
EquationsFeature({}), // LaTex (well KaTeX) equations
EmojisFeature({}), // Adds new Emoji nodes with new, different-looking emojis
EmojiPickerFeature({}), // Use in combination with EmojisPlugin. When you start typing ":" it will show you different emojis you can use. They also look different!
HorizontalRuleFeature({}), // Horizontal rule in the editor.
FigmaFeature({}), // Figma Embed
YouTubeFeature({}), // YouTube Embed
TwitterFeature({}), // Twitter Embed
SpeechToTextFeature({}), // Adds a Speech-to-text button in the Actions menu (bottom right of the editor). When you click on it and speak, it converts the speech into text
ImportFeature({}), // Acion button: import
ExportFeature({}), // Acion button: export
ClearEditorFeature({}), // Adds a button in the action menu which clears the editor
ReadOnlyModeFeature({}), // Acion button: toggle read-only mode on or off
ConvertFromMarkdownFeature({}), // Acion button: convert from markdown
MentionsFeature({}), // Ability to mention someone when you type "@"
TreeViewFeature({ enabled: defaultEditorConfig.debug }), // If enabled, will show the node representation of the editor under the editor. Good for debugging
KeywordsFeature({}), // Highlights certain words
AutoCompleteFeature({}), // Autocompletes certain words while typing
CollapsibleFeature({}), // Adds a "collapsible" node
TypingPerfFeature({ enabled: defaultEditorConfig.debug }), // Some debug tool for performance testing
PasteLogFeature({ enabled: defaultEditorConfig.debug }), // Another debug tool
TestRecorderFeature({ enabled: defaultEditorConfig.debug }), // Another debug tool used for lexical core development, with which you can automatically generate tests
LinkFeature({}), // Obvious: hyperlinks! This includes the AutoLink plugin.
TableOfContentsFeature({ enabled: false }), // Shows a table of contents on the right hand-side of the screen
AISuggestFeature({}), // Make sure you set your openai key in the plugin config to be able to use it
];
// A feature can consist of nodes, plugins, modals, toolbar elements and more! YourOwnCustomFeature must be of type "Feature"
defaultEditorConfig.features.push(YourOwnCustomFeature({}));
return defaultEditorConfig;
},
}),
],
};
export default Lexical;
This example can also be found in the demo!
Feel free to use my serializer in the serialize-example folder of this repo. Lexical is using bitwise operations for the node formats.
This currently serialized the most important stuff, but not everything. Feel free to contribute to it if you add more!
Since this is based on their playground, you gotta upstream their changes. Then, the following is additionally copied over outside of the playground package - needs to be considered in lexical updates as well:
payload paste as markdown
Lexical editor feature for pasting raw Markdown through a toolbar button, slash command, or drawer
631.2k/wk0v3
payload code block feature
Adds a code block feature to the Payload Lexical editor using @lexical/code
397/wk11v2
ox payload editorial
Editorial Lexical blocks written as markdown directives, with lossless round trip and token-styled rendering
250v3 v4
richtext
Rich-text child block, default Lexical editor preset and JSX renderer for Atomic Payload
6433/wk37v3
payload richtext lexical react native
React Native renderer for serialized Lexical rich text content from Payload CMS
3918/wk0v3
payload shiki code
Server-rendered Shiki syntax-highlighted code block for Payload Lexical richtext fields
372.2k/wk3v3