Skip to content

Markdown variables

A document can keep its structure while its values change. This guide is using Acme Industrial as its example account. Open Data or choose another account to see the same document resolve again.

Write a placeholder

Use {{customer.name}} in ordinary Markdown. Values are resolved in the parsed document, so a value remains text rather than becoming new Markdown structure.

Hello Dana. Your next renewal is November 1, 2026.

Format the value

Dates, currencies, and percentages can use formatters and a locale. Change the locale in Data and watch the example below.

ItemValue
Subscription$4,800.00
Overage$312.50
Usage78%

Inside a Markdown table, escape a formatter's pipe as \| so it stays in the cell.

Resolve in React

npm install @react-markdown-kit/renderer @react-markdown-kit/variables
import Markdown from '@react-markdown-kit/renderer'
import { variables } from '@react-markdown-kit/variables'

<Markdown extensions={[variables({ data: account, locale: 'en-US' })]}>
  {source}
</Markdown>

Placeholders inside code stay literal. For example, {{customer.name}} describes the syntax instead of resolving it.

Keep data and writing separate

The Source panel contains the authored Markdown. The Data panel contains the values passed to the plugin. Editing one does not rewrite the other.

Try a missing field to see a diagnostic, or a value containing Markdown to see it stay text. Restore the example with Reset.

Keep going

Explore schemas, formatting, and authoring placeholders. The editor can display the same placeholders as editable chips.