Adds extra features to the Payload CMS Lexical rich text editor. Each feature is imported and added to the lexicalEditor features array, and can be used alone or together. JSX and HTML converters are provided for rendering the content on the frontend, and a CSS file must be imported for the color features.
Extended lexical editor features for Payload CMS
Installation
npm i payloadcms-lexical-ext73
Stars
19
Forks
14
Open Issues
1 years ago
Last Updated
0
Weekly Downloads
v0.5.3
npm Version
171.0 KB
Unpacked Size
2
Dependencies
Trends appear after 7 days of data. Daily snapshots have not started yet.
Trends appear after 7 days of data. Daily snapshots have not started yet.
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/907855621-root)<a href="https://payloaddirectory.dev/plugins/907855621-root"><img src="https://payloaddirectory.dev/badge/907855621-root.svg" alt="Payload Directory"></a>README
Ideal for content creators and developers who want to enrich their text content with more visual appeal.
This plugin adds new features to the Payload CMS lexical editor. You can use any of the features on its own or all of them togehter:
New features will be added - Create issues for new features or create them yourself and create a PR to share it with the community




npm install payloadcms-lexical-ext
or
yarn add payloadcms-lexical-ext
import { BgColorFeature, HighlightColorFeature, TextColorFeature, YoutubeFeature, VimeoFeature } from 'payloadcms-lexical-ext';
import 'payloadcms-lexical-ext/client/client.css'
lexicalEditor({
features: [
...defaultEditorFeatures,
...YourFeatures...
TextColorFeature(),
HighlightColorFeature(),
BgColorFeature(),
YoutubeFeature(),
VimeoFeature()
]
});
Add JSX or HTML converters
4.1 JSX Converters
components/RichText/index.tsx
import { JSXConverters } from 'payloadcms-lexical-ext'
const jsxConverters: JSXConvertersFunction<NodeTypes> = ({ defaultConverters }) => ({
...defaultConverters,
...JSXConverters
})
4.2 HTML Converters
import { consolidateHTMLConverters, convertLexicalToHTML, sanitizeServerEditorConfig } from '@payloadcms/richtext-lexical'
import { HTMLConverters } from 'payloadcms-lexical-ext'
...
const sanitizedEditorConfig = await sanitizeServerEditorConfig(editorConfig, req.payload.config)
await convertLexicalToHTML({
converters: [
...HTMLConverters,
...consolidateHTMLConverters({ editorConfig: sanitizedEditorConfig })
],
data: jsonEditorContent,
req,
})
The plugin comes with several customizable options:
TextColorFeature({
colors: [{
type: 'button',
label: 'Custom color',
color: '#1155aa'
}]
});
Contributions are welcome! To get started:
This project is licensed under the MIT License.
For questions or suggestions, feel free to open an issue or reach out to the Payload CMS community.
payload lexical typography
Lexical editor features for text color, font size, letter spacing, line height and font family
571.1k/wk109v?
fullscreen editor
Fullscreen mode for the Payload Lexical rich text editor
680/wk114v3
richtext
Rich-text child block, default Lexical editor preset and JSX renderer for Atomic Payload
610/wk37v3
payload paste as markdown
Lexical editor feature for pasting raw Markdown via a toolbar button, slash command, or drawer
570/wk0v3
payload editor
Preset-based, deterministic configuration builder for the Payload Lexical rich text editor
564/wk2v3
payload richtext lexical react native
React Native renderer for serialized Lexical rich text content from Payload CMS
420/wk0v3