Adds a Lexical feature that lets editors insert dynamic variables into rich text by typing a trigger character such as @. Variables are pulled from chosen collections and globals or from manually defined fields, and appear as non-editable badges. Frontend rendering needs the plugin's JSX converters or its wrapper component. Requires Payload 3.37 or later.
Dynamic Value Rich Text Plugin for PayloadCMS
Installation
npm i @od-labs/payloadcms-dynamic-value-richtext1
Stars
0
Forks
1
Open Issues
9 months ago
Last Updated
17
Weekly Downloads
v1.1.0
npm Version
112.9 KB
Unpacked Size
1
Dependencies
10 since Sep 7
| Date | Stars |
|---|---|
| Dec 6, 2026 | 1 |
| Dec 5, 2026 | 1 |
| Dec 4, 2026 | 1 |
| Dec 3, 2026 | 1 |
| Dec 2, 2026 | 1 |
| Dec 1, 2026 | 1 |
| Nov 30, 2026 | 1 |
| Nov 29, 2026 | 1 |
| Nov 28, 2026 | 1 |
| Nov 27, 2026 | 1 |
| Nov 26, 2026 | 1 |
| Nov 25, 2026 | 1 |
| Nov 24, 2026 | 1 |
| Nov 23, 2026 | 1 |
| Nov 22, 2026 | 1 |
| Nov 21, 2026 | 1 |
| Nov 20, 2026 | 1 |
| Nov 19, 2026 | 1 |
| Nov 18, 2026 | 1 |
| Nov 17, 2026 | 1 |
| Nov 16, 2026 | 1 |
| Nov 15, 2026 | 1 |
| Nov 14, 2026 | 1 |
| Nov 13, 2026 | 1 |
| Nov 12, 2026 | 1 |
| Nov 11, 2026 | 1 |
| Nov 10, 2026 | 1 |
| Nov 9, 2026 | 1 |
| Nov 8, 2026 | 1 |
| Nov 7, 2026 | 1 |
| Nov 6, 2026 | 1 |
| Nov 5, 2026 | 1 |
| Nov 4, 2026 | 1 |
| Nov 3, 2026 | 1 |
| Nov 2, 2026 | 1 |
| Nov 1, 2026 | 1 |
| Oct 31, 2026 | 1 |
| Oct 30, 2026 | 1 |
| Oct 29, 2026 | 1 |
| Oct 28, 2026 | 1 |
| Oct 27, 2026 | 1 |
| Oct 26, 2026 | 1 |
| Oct 25, 2026 | 1 |
| Oct 24, 2026 | 1 |
| Oct 23, 2026 | 1 |
| Oct 22, 2026 | 1 |
| Oct 21, 2026 | 1 |
| Oct 20, 2026 | 1 |
| Oct 19, 2026 | 1 |
| Oct 18, 2026 | 1 |
| Oct 17, 2026 | 1 |
| Oct 16, 2026 | 1 |
| Oct 15, 2026 | 1 |
| Oct 14, 2026 | 1 |
| Oct 13, 2026 | 1 |
| Oct 12, 2026 | 1 |
| Oct 11, 2026 | 1 |
| Oct 10, 2026 | 1 |
| Oct 9, 2026 | 1 |
| Oct 8, 2026 | 1 |
| Oct 7, 2026 | 1 |
| Oct 6, 2026 | 1 |
| Oct 5, 2026 | 1 |
| Oct 4, 2026 | 1 |
| Oct 3, 2026 | 1 |
| Oct 2, 2026 | 1 |
| Oct 1, 2026 | 1 |
| Sep 30, 2026 | 1 |
| Sep 29, 2026 | 1 |
| Sep 28, 2026 | 1 |
| Sep 27, 2026 | 1 |
| Sep 26, 2026 | 1 |
| Sep 25, 2026 | 1 |
| Sep 24, 2026 | 1 |
| Sep 23, 2026 | 1 |
| Sep 22, 2026 | 1 |
| Sep 21, 2026 | 1 |
| Sep 20, 2026 | 1 |
| Sep 19, 2026 | 1 |
| Sep 18, 2026 | 1 |
| Sep 17, 2026 | 1 |
| Sep 16, 2026 | 1 |
| Sep 15, 2026 | 1 |
| Sep 14, 2026 | 1 |
| Sep 13, 2026 | 1 |
| Sep 12, 2026 | 1 |
| Sep 11, 2026 | 1 |
| Sep 10, 2026 | 1 |
| Sep 9, 2026 | 1 |
| Sep 8, 2026 | 1 |
| Sep 7, 2026 | 1 |
18+2 since Sep 7
| Date | Weekly downloads |
|---|---|
| Dec 6, 2026 | 18 |
| Dec 5, 2026 | 8 |
| Dec 4, 2026 | 10 |
| Dec 3, 2026 | 10 |
| Dec 2, 2026 | 4 |
| Dec 1, 2026 | 15 |
| Nov 30, 2026 | 15 |
| Nov 29, 2026 | 14 |
| Nov 28, 2026 | 14 |
| Nov 27, 2026 | 12 |
| Nov 26, 2026 | 11 |
| Nov 25, 2026 | 11 |
| Nov 24, 2026 | 1 |
| Nov 23, 2026 | 2 |
| Nov 22, 2026 | 4 |
| Nov 21, 2026 | 4 |
| Nov 20, 2026 | 8 |
| Nov 19, 2026 | 8 |
| Nov 18, 2026 | 8 |
| Nov 17, 2026 | 9 |
| Nov 16, 2026 | 11 |
| Nov 15, 2026 | 10 |
| Nov 14, 2026 | 10 |
| Nov 13, 2026 | 17 |
| Nov 12, 2026 | 18 |
| Nov 11, 2026 | 21 |
| Nov 10, 2026 | 23 |
| Nov 9, 2026 | 20 |
| Nov 8, 2026 | 24 |
| Nov 7, 2026 | 24 |
| Nov 6, 2026 | 13 |
| Nov 5, 2026 | 12 |
| Nov 4, 2026 | 12 |
| Nov 3, 2026 | 8 |
| Nov 2, 2026 | 10 |
| Nov 1, 2026 | 6 |
| Oct 31, 2026 | 6 |
| Oct 30, 2026 | 6 |
| Oct 29, 2026 | 6 |
| Oct 28, 2026 | 3 |
| Oct 27, 2026 | 5 |
| Oct 26, 2026 | 4 |
| Oct 25, 2026 | 3 |
| Oct 24, 2026 | 3 |
| Oct 23, 2026 | 3 |
| Oct 22, 2026 | 4 |
| Oct 21, 2026 | 4 |
| Oct 20, 2026 | 2 |
| Oct 19, 2026 | 2 |
| Oct 18, 2026 | 2 |
| Oct 17, 2026 | 3 |
| Oct 16, 2026 | 3 |
| Oct 15, 2026 | 2 |
| Oct 14, 2026 | 3 |
| Oct 13, 2026 | 3 |
| Oct 12, 2026 | 2 |
| Oct 11, 2026 | 3 |
| Oct 10, 2026 | 2 |
| Oct 9, 2026 | 2 |
| Oct 8, 2026 | 2 |
| Oct 7, 2026 | 1 |
| Oct 6, 2026 | 1 |
| Oct 5, 2026 | 1 |
| Oct 4, 2026 | 0 |
| Oct 3, 2026 | 1 |
| Oct 2, 2026 | 1 |
| Oct 1, 2026 | 1 |
| Sep 30, 2026 | 1 |
| Sep 29, 2026 | 1 |
| Sep 28, 2026 | 1 |
| Sep 27, 2026 | 1 |
| Sep 26, 2026 | 3 |
| Sep 25, 2026 | 3 |
| Sep 24, 2026 | 3 |
| Sep 23, 2026 | 3 |
| Sep 22, 2026 | 3 |
| Sep 21, 2026 | 8 |
| Sep 20, 2026 | 8 |
| Sep 19, 2026 | 5 |
| Sep 18, 2026 | 5 |
| Sep 17, 2026 | 5 |
| Sep 16, 2026 | 8 |
| Sep 15, 2026 | 9 |
| Sep 14, 2026 | 4 |
| Sep 13, 2026 | 4 |
| Sep 12, 2026 | 5 |
| Sep 11, 2026 | 14 |
| Sep 10, 2026 | 15 |
| Sep 9, 2026 | 13 |
| Sep 8, 2026 | 16 |
| Sep 7, 2026 | 16 |
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/1167287088-root)<a href="https://payloaddirectory.dev/plugins/1167287088-root"><img src="https://payloaddirectory.dev/badge/1167287088-root.svg" alt="Payload Directory"></a>README
A powerful Payload CMS plugin for the Lexical editor that allows you to designate field values as dynamic variables. These variables can be reused throughout your rich text content and are visually represented as interactive badges.
@ (default) or a custom character (like #).pnpm add @od-labs/payloadcms-dynamic-value-richtext
# or
npm install @od-labs/payloadcms-dynamic-value-richtext
Add the plugin to your payload.config.ts:
import { buildConfig } from 'payload'
import { dynamicValuePlugin } from '@od-labs/payloadcms-dynamic-value-richtext'
export default buildConfig({
plugins: [
dynamicValuePlugin({
collections: ['company-settings', 'sites'],
globals: ['contact-info'],
trigger: '@',
}),
],
// ... rest of config
})
In your Lexical editor configuration, add the DynamicValueFeature to your list of features:
import { DynamicValueFeature } from '@od-labs/payloadcms-dynamic-value-richtext'
// In your collection/global field definition:
{
name: 'content',
type: 'richText',
editor: lexicalEditor({
features: ({ defaultFeatures }) => [
...defaultFeatures,
DynamicValueFeature(),
],
}),
}
| Option | Type | Description |
|---|---|---|
collections | CollectionSlug[] | Automatically extract all text-based fields from these collections. |
globals | GlobalSlug[] | Automatically extract all text-based fields from these globals. |
fields | Field[] | Manually provide a list of Payload fields to be used as dynamic values. |
trigger | string | The character that triggers the autocomplete popup. Defaults to @. |
contact-info with a field email, it becomes available as contact-info.email.DecoratorNode in Lexical, which holds a reference to the field path (value) and the display label.If you render Lexical content on your website with RichText, you must provide this plugin's JSX converters.
Without this, Payload will show custom nodes as unknown node.
Use the plugin-provided wrapper component that injects converters for you:
import { DynamicValueRichText } from '@od-labs/payloadcms-dynamic-value-richtext/react'
<DynamicValueRichText data={page.content} payloadData={page} />
import { RichText } from '@payloadcms/richtext-lexical/react'
import { DynamicValueJSXConverters } from '@od-labs/payloadcms-dynamic-value-richtext/jsx'
<RichText data={page.content} converters={DynamicValueJSXConverters} />
If you want to resolve the dynamic value from real document data at render time:
import { createDynamicValueJSXConverters } from '@od-labs/payloadcms-dynamic-value-richtext/jsx'
const converters = createDynamicValueJSXConverters({ data: page })
To run the development environment:
pnpm install.env in the dev folder (see .env.example)pnpm devCreated & Owned by OD LABS. This plugin is open and free for use to all under the MIT License.
Contributions are welcome! If you have ideas for improvements or find any issues, feel free to open a Pull Request or create an Issue.
MIT
richtext
Rich-text child block, default Lexical editor preset and JSX renderer for Atomic Payload
6433/wk37v3
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
payload shiki code
Server-rendered Shiki syntax-highlighted code block for Payload Lexical richtext fields
372.2k/wk3v3
payload plugin lexical
Lexical-based rich text editor field for Payload 1.x with tables, embeds, and a customizable feature set
35152/wk213v1
ox payload editorial
Editorial Lexical blocks written as markdown directives, with lossless round trip and token-styled rendering
250v3 v4