Skip to main content

Free and open source, no account needed

Free Online Markdown Editor for React

A rich text editor that reads and writes plain Markdown. It’s free, runs in your browser and doesn’t need an account. You can write in rich, source or preview mode, add typed variables and Mermaid diagrams, and what you save is the same string you opened.

Editor docsnpmGitHubReact Markdown Kit

  • Saves plain MarkdownYour app keeps storing plain strings. All 22 audited documents open and save byte for byte, and that suite runs in CI.
  • Three modesRich, source and preview, and you can switch between them at any time. The toolbar is optional, and you can use the engine headless if you want.
  • PluginsTemplate variables shown as chips, Mermaid flowcharts on a canvas, and slide decks. Each one is a separate package.

Install the editor and the two plugins this demo uses

npm install @react-markdown-kit/editor @react-markdown-kit/renderer
npm install @react-markdown-kit/template @react-markdown-kit/mermaid

The editor needs the renderer for its preview mode and its parser. The template and Mermaid packages are optional plugins, so you only need them if you want variables or diagrams.

Edit Markdown in three steps

  1. Mount the editor. It takes Markdown and gives you Markdown back, so your app keeps storing plain strings, and opening and closing a document doesn’t change it. The stylesheet is optional (the editor works without it).
    'use client'
    
    import { useState } from 'react'
    import { MarkdownEditor } from '@react-markdown-kit/editor'
    import '@react-markdown-kit/editor/styles.css'
    
    export function Notes() {
      const [value, setValue] = useState('# Notes\n\nStart writing.')
      return <MarkdownEditor value={value} onChange={setValue} />
    }
  2. Share a dialect. Define your Markdown features once in a preset and pass it to both the editor and the renderer. A ```mermaid fence becomes a canvas in the editor and static SVG in the renderer.
    import { defineMarkdownPreset, gfm } from '@react-markdown-kit/renderer'
    import { MarkdownEditor } from '@react-markdown-kit/editor'
    import { mermaid } from '@react-markdown-kit/mermaid/editor'
    
    export const preset = defineMarkdownPreset({ extensions: [gfm(), mermaid()] })
    
    <MarkdownEditor preset={preset} value={value} onChange={setValue} />
  3. Add variables. The template plugin shows placeholders as chips while you write and resolves them when rendering. Values go into the parsed tree, which means data can’t inject Markdown.
    import Markdown from '@react-markdown-kit/renderer'
    import { MarkdownEditor } from '@react-markdown-kit/editor'
    import { template } from '@react-markdown-kit/template'
    import { templateVariables } from '@react-markdown-kit/template/editor'
    
    // Authoring: every {{placeholder}} is a chip that previews the sample data.
    <MarkdownEditor
      preset={preset}
      extensions={[templateVariables({ previewData: customer })]}
      value={source}
      onChange={setSource}
    />
    
    // Rendering: the same source, resolved for one customer.
    <Markdown preset={preset} extensions={[template({ data: customer })]}>
      {source}
    </Markdown>

More docs. Editor basics covers modes, controlled and uncontrolled use and images, headless shows how to keep the engine and replace the chrome, and round trip explains how documents come through editing byte for byte. For the plugins, see templates and Mermaid.

Paste Markdown, save it, read the diff

Paste a document below. The editor opens it and saves it straight back through the same headless bridge as packages/editor/tests/roundtrip.test.ts, then the panel diffs what you pasted against what was saved, line by line, and tells you if they match. The box starts out with things another editor corrupted in the audit (a setext heading, a list starting at 3, a nested quote, double backtick code, underscore emphasis and a reference link).

That suite runs 22 audited documents in CI and fails the build if any of them comes back changed. Round trip lists the cases and what each one used to break.

About this editor

  • The sample is a customer report, written once and resolved for one account. If you edit the template on the left, the right pane updates, since you changed the document and the data stayed the same. What gets saved is the placeholder. The chip only previews the value.
  • You can edit the flowchart in place. If you drag a box, the saved Markdown is still plain Mermaid with one layout comment, and the placeholders around it aren’t touched. The Mermaid editor shows the same thing on its own.
  • “Copy link” compresses the whole document into the URL hash and gives you the link. Nothing is uploaded and there’s no account involved. Opening the link loads the document back into the editor.
  • If you only install the renderer, you don’t pull in any editor code or Lexical. The template and Mermaid root entries don’t call React either, so the same resolution can run in a worker, a CLI or an email job. The security model covers what to watch for when you mix authored text with runtime data.

Questions

Is there a free online Markdown editor for React?
This page is one. It runs in the browser, doesn’t need an account and saves plain Markdown. The component behind it is @react-markdown-kit/editor, which is MIT licensed. The package on npm.
Is it a WYSIWYG Markdown editor?
Rich mode is WYSIWYG, source mode shows the Markdown and preview mode shows the rendered output. You can switch whenever you like, and the document is the same string in all three. Editor basics.
Does the editor change my Markdown?
No. If you open a document and save it, it stays byte for byte the same. We took 22 documents from an audit of another editor, all 22 round-trip unchanged, and that suite runs in CI. The round-trip suite.
Can I check the round trip on my own Markdown?
Yes. Paste a document into the round-trip panel on this page. The editor opens it and saves it back, then the panel shows a line diff (or tells you the two are identical). The same bridge the test suite runs.
What is the editor built on?
Lexical. The React component wraps a Lexical editor, and there’s a headless API that gives you the same engine without the toolbar and chrome. Headless use.
Can I add variables and diagrams?
Yes. The template plugin shows {{placeholders}} as chips while you write and resolves them at render time. The Mermaid plugin turns a mermaid fence into a canvas you can draw on. Template basics.
Does it need a design system?
No. The editor ships an optional stylesheet and reads CSS custom properties. None of the packages use Tailwind, a theme provider or CSS-in-JS. Styling options.