Exapedia / Tools / React Markdown editor libraries React Markdown editor libraries Updated Nov 2026
React Markdown editor libraries add a writing surface to a React app that stores content as Markdown. An editor either shows the Markdown source beside a rendered preview or hides the syntax behind formatted text. These libraries let documentation tools, content dashboards, and note-taking apps keep user writing as portable plain text.
Popularity @tiptap/react @monaco-editor/react @lexical/react @uiw/react-codemirror @mdxeditor/editor @uiw/react-md-editor @blocknote/react @tinymce/tinymce-react FAQ Popularity @tiptap/react has the most monthly downloads in this comparison, at 112.3M , a count that covers all its rich text editing.
Libraries and code examples Provides React components for Tiptap.
Downloads / mo 112.3M
Stars 39.1K
Last release 3.34.0
License MIT $ npm install @tiptap/react @tiptap/pm @tiptap/starter-kit @tiptap/markdown Copy
import { EditorContent, useEditor } from '@tiptap/react'
import StarterKit from '@tiptap/starter-kit'
import { Markdown } from '@tiptap/markdown'
export default function App() {
const editor = useEditor({ extensions: [StarterKit, Markdown], content: '# Hello', contentType: 'markdown' })
return <EditorContent editor={editor} />
}
Uses the Monaco editor in any React application without webpack or other bundler configuration files.
Downloads / mo 38.6M
Stars 4.8K
Last release 4.7.0
License MIT $ npm install @monaco-editor/react Copy
import Editor from '@monaco-editor/react'
export default function App() {
return <Editor height="300px" defaultLanguage="markdown" defaultValue="# Hello" />
}
Provides Lexical components and hooks for React applications.
Downloads / mo 30.7M
Stars 24.0K
Last release 0.53.0
License MIT $ npm install react react-dom lexical@0.53.0 @lexical/react@0.53.0 @lexical/rich-text@0.53.0 Copy
import { LexicalExtensionComposer } from '@lexical/react/LexicalExtensionComposer';
import { RichTextExtension } from '@lexical/rich-text';
import { defineExtension } from 'lexical';
const extension = defineExtension({ name: 'example', namespace: 'example', dependencies: [RichTextExtension] });
export default function App() {
return <LexicalExtensionComposer extension={extension} />;
}
@lexical/react examples From open-source projects on GitHub export const LexicalEditor: React.FC<
{
editorContainerRef: React.RefObject<HTMLDivElement | null>
isSmallWidthViewport: boolean
} & Pick<LexicalProviderProps, 'editorConfig' | 'onChange' | 'rtl'>
> = (props) => {
const { editorConfig, editorContainerRef, isSmallWidthViewport, onChange, rtl } = props
const editorConfigContext = useEditorConfigContext()
const [editor] = useLexicalComposerContext()
const isEditable = useLexicalEditable()
const { t } = useTranslation<Record<string, never>, string>()
const instructionsID = React.useId()
const hasTabIndentation = isEditable && editorConfig.features.enabledFeatures.includes('indent')
const [floatingAnchorElem, setFloatingAnchorElem] = useState<HTMLDivElement | null>(null)
const onRef = (_floatingAnchorElem: HTMLDivElement) => {
if (_floatingAnchorElem !== null) {
setFloatingAnchorElem(_floatingAnchorElem)
}
}
useEffect(() => {
if (!editorConfigContext?.uuid) {
console.error('Lexical Editor must be used within an EditorConfigProvider')
return
}
if (editorConfigContext?.parentEditor?.uuid) {
editorConfigContext.parentEditor?.registerChild(editorConfigContext.uuid, editorConfigContext)
}
const handleFocus = () => {
editorConfigContext.focusEditor(editorConfigContext)
}
const handleBlur = () => {
editorConfigContext.blurEditor(editorConfigContext)
}
const unregisterFocus = editor.registerCommand(
FOCUS_COMMAND,
() => {
handleFocus()
return true
},
COMMAND_PRIORITY_LOW,
)
const unregisterBlur = editor.registerCommand(
BLUR_COMMAND,
() => {
handleBlur()
return true
},
COMMAND_PRIORITY_LOW,
)
return () => {
unregisterFocus()
unregisterBlur()
editorConfigContext.parentEditor?.unregisterChild?.(editorConfigContext.uuid)
}
}, [editor, editorConfigContext])
return (
<React.Fragment>
{editorConfig.features.plugins?.map((plugin) => {
if (plugin.position === 'aboveContainer') {
return <EditorPlugin clientProps={plugin.clientProps} key={plugin.key} plugin={plugin} />
}
})}
<div className="editor-container" dir={rtl ? 'rtl' : undefined} ref={editorContainerRef}>
{editorConfig.features.plugins?.map((plugin) => {
if (plugin.position === 'top') {
return (
<EditorPlugin clientProps={plugin.clientProps} key={plugin.key} plugin={plugin} />
)
}
})}
<RichTextPlugin
contentEditable={
<div className="editor-scroller">
<div className="editor" ref={onRef}>
<LexicalContentEditable
editorConfig={editorConfig}
instructionsID={hasTabIndentation ? instructionsID : undefined}
/>
</div>
</div>
}
ErrorBoundary={LexicalErrorBoundary}
/>
<NormalizeSelectionPlugin />
{isEditable && <InsertParagraphAtEndPlugin />}
<DecoratorPlugin />
<ClipboardPlugin />
<TextPlugin features={editorConfig.features} />
<SelectAllPlugin />
<NodeViewOverridePlugin />
{isEditable && (
<OnChangePlugin
// Selection changes can be ignored here, reducing the
// frequency that the FieldComponent and Payload receive updates.
// Selection changes are only needed if you are saving selection state
ignoreSelectionChange
onChange={(editorState, editor, tags) => {
// Ignore any onChange event triggered by focus only
if (!tags.has('focus') || tags.size > 1) {
if (onChange != null) {
onChange(editorState, editor, tags)
}
}
}}
/>
)}
{floatingAnchorElem && (
<React.Fragment>
{!isSmallWidthViewport && isEditable && (
<React.Fragment>
{editorConfig.admin?.hideDraggableBlockElement ? null : (
<DraggableBlockPlugin anchorElem={floatingAnchorElem} />
)}
{editorConfig.admin?.hideAddBlockButton ? null : (
<AddBlockHandlePlugin anchorElem={floatingAnchorElem} />
)}
</React.Fragment>
)}
{editorConfig.features.plugins?.map((plugin) => {
if (
plugin.position === 'floatingAnchorElem' &&
!(plugin.desktopOnly === true && isSmallWidthViewport)
) {
return (
<EditorPlugin
anchorElem={floatingAnchorElem}
clientProps={plugin.clientProps}
key={plugin.key}
plugin={plugin}
/>
)
}
})}
{isEditable && (
<React.Fragment>
<SlashMenuPlugin anchorElem={floatingAnchorElem} />
</React.Fragment>
)}
</React.Fragment>
)}
{isEditable && (
<React.Fragment>
<HistoryPlugin />
{editorConfig?.features?.markdownTransformers?.length > 0 && <MarkdownShortcutPlugin />}
</React.Fragment>
)}
{editorConfig.features.plugins?.map((plugin) => {
if (plugin.position === 'normal') {
return (
<EditorPlugin clientProps={plugin.clientProps} key={plugin.key} plugin={plugin} />
)
}
})}
{editorConfig.features.plugins?.map((plugin) => {
if (plugin.position === 'bottom') {
return (
<EditorPlugin clientProps={plugin.clientProps} key={plugin.key} plugin={plugin} />
)
}
})}
</div>
{hasTabIndentation && (
<p className="ContentEditable__keyboard-hint" id={instructionsID}>
{t('lexical:indent:keyboardHint')}
</p>
)}
{editorConfig.features.plugins?.map((plugin) => {
if (plugin.position === 'belowContainer') {
return <EditorPlugin clientProps={plugin.clientProps} key={plugin.key} plugin={plugin} />
}
})}
</React.Fragment>
)
}
Show full example Provides a CodeMirror component for React.
Downloads / mo 27.3M
Stars 2.3K
Last release 4.25.12
License MIT $ npm install @uiw/react-codemirror @codemirror/lang-markdown Copy
import CodeMirror from '@uiw/react-codemirror'
import { markdown } from '@codemirror/lang-markdown'
export default function App() {
return <CodeMirror value="# Hello" extensions={[markdown()]} />
}
@uiw/react-codemirror examples From open-source projects on GitHub export default function MarkdownEditor({
value,
onChange,
readOnly = false,
onView,
}: {
value: string;
onChange: (value: string) => void;
readOnly?: boolean;
/** Receives the live CodeMirror view (for the extension editor API). */
onView?: (view: EditorView) => void;
}) {
const dark = usePrefersDark();
return (
<CodeMirror
value={value}
onChange={onChange}
readOnly={readOnly}
onCreateEditor={(view) => onView?.(view)}
theme={dark ? "dark" : "light"}
extensions={[
// codeLanguages lights up fenced code blocks (```go, ```ts, …)
// with each language's own grammar while editing.
markdown({ codeLanguages: languages }),
baseTheme,
EditorView.lineWrapping,
]}
basicSetup={{
lineNumbers: true,
foldGutter: false,
highlightActiveLine: !readOnly,
highlightActiveLineGutter: !readOnly,
}}
height="100%"
className="h-full overflow-hidden rounded-lg border border-line"
/>
);
}
Show full example Provides formatted Markdown editing with optional JSX component editors.
Downloads / mo 7.7M
Stars 3.7K
Last release 4.5.0
License MIT Strengths Edits Markdown as formatted content . Authors edit documents naturally, with headings, tables, and images. Edits embedded JSX components . Use the built-in JSX editor or supply a custom one. Limitations Requires client rendering . Render the editor and initialize its plugins only on the client. External updates need a ref . Call setMarkdown to change content after the initial value. $ npm install react react-dom @mdxeditor/editor Copy
import { MDXEditor } from '@mdxeditor/editor';
import '@mdxeditor/editor/style.css';
export default function App() {
return <MDXEditor markdown='Hello world' />;
}
@mdxeditor/editor examples From open-source projects on GitHub export const MarkdownEditor = ({
value,
onChange,
placeholder,
className,
autoFocus,
readOnly,
onKeyDown,
id,
}: MarkdownEditorProps) => {
const editorRef = useRef<MDXEditorMethods>(null)
const plugins = usePlugins(readOnly)
const lastSetMarkdown = useRef(value)
useEffect(() => {
if (lastSetMarkdown.current === value) return
const current = editorRef.current?.getMarkdown() ?? ''
if (current !== value) {
lastSetMarkdown.current = value
editorRef.current?.setMarkdown(value)
}
}, [value])
const handlePaste = (e: React.ClipboardEvent<HTMLDivElement>) => {
const text = e.clipboardData.getData('text/plain')
if (!text) return
const markdownPattern =
/^#{1,6}\s|^\s*[-*+]\s|^\s*\d+\.\s|\*\*.+\*\*|__.+__|\[.+\]\(.+\)|^>/m
if (!markdownPattern.test(text)) return
e.preventDefault()
e.stopPropagation()
editorRef.current?.insertMarkdown(text)
}
return (
<div id={id} className={cn('mdx-editor-outer', className)}>
{/* biome-ignore lint/a11y/noStaticElementInteractions: onKeyDown/onPasteCapture forwarding */}
<div
className="mdx-editor-themed"
onKeyDown={onKeyDown}
onPasteCapture={handlePaste}
>
<MDXEditor
ref={editorRef}
markdown={value}
onChange={onChange}
placeholder={placeholder}
plugins={plugins}
autoFocus={autoFocus}
readOnly={readOnly}
contentEditableClassName="mdx-content-editable prose prose-sm max-w-none dark:prose-invert"
/>
</div>
<div className="mdx-copy-bar">
<CopyMarkdownButton editorRef={editorRef} />
</div>
</div>
)
}
Show full example Provides a React Markdown text editor with syntax highlighting and preview.
Downloads / mo 4.2M
Stars 2.9K
Last release 4.2.4
License MIT Strengths Edits source beside its preview . Use the editor and Markdown preview with shared React state. Supports custom toolbar commands . Supply commands to customize the editing toolbar. Limitations Untrusted content needs sanitizing . Add rehype-sanitize when Markdown authors cannot be trusted. Next.js needs client rendering . Load the editor dynamically with server rendering disabled. $ npm i @uiw/react-md-editor Copy
import React from 'react'
import MDEditor from '@uiw/react-md-editor'
export default function App() {
const [value, setValue] = React.useState('# Hello')
return <MDEditor value={value} onChange={setValue} />
}
Provides a Notion-style, block-based, extensible text editor built on ProseMirror and Tiptap.
Downloads / mo 3.8M
Stars 10.4K
Last release 0.57.0
License MPL-2.0 $ npm install react react-dom @blocknote/core @blocknote/react @blocknote/mantine @mantine/core @mantine/hooks @mantine/utils Copy
import { useCreateBlockNote } from '@blocknote/react';
import { BlockNoteView } from '@blocknote/mantine';
import '@blocknote/core/fonts/inter.css';
import '@blocknote/mantine/style.css';
export default function App() {
const editor = useCreateBlockNote();
return <BlockNoteView editor={editor} />;
}
@blocknote/react examples From open-source projects on GitHub () => {
const selectedText = editor.getSelectedText();
const selection = editor.getSelection();
if (selectedText && selection) {
if (!artifact) {
console.error("Artifact not found");
return;
}
const currentBlockIdx = artifact.currentIndex;
const currentContent = artifact.contents.find(
(c) => c.index === currentBlockIdx
);
if (!currentContent) {
console.error("Current content not found");
return;
}
if (!isArtifactMarkdownContent(currentContent)) {
console.error("Current content is not markdown");
return;
}
(async () => {
const [markdownBlock, fullMarkdown] = await Promise.all([
editor.blocksToMarkdownLossy(selection.blocks),
editor.blocksToMarkdownLossy(editor.document),
]);
setSelectedBlocks({
fullMarkdown: cleanText(fullMarkdown),
markdownBlock: cleanText(markdownBlock),
selectedText: cleanText(selectedText),
});
})();
}
}
Show full example Provides the official React component for the TinyMCE rich text editor.
Downloads / mo 3.3M
Stars 1.1K
Last release 6.3.1
License MIT $ npm install @tinymce/tinymce-react Copy
import { Editor } from '@tinymce/tinymce-react'
export default function App() {
return <Editor apiKey="your-api-key" init={{ plugins: 'markdown' }} initialValue="<p>Hello</p>" />
}
For coding agents
Found your Markdown editor library? Help your agent use it. Connect Exa so your coding agent can find the library’s documentation, check its API, and look up implementations while you build.
Claude Code Cursor Codex VS Code Devin Devin Desktop Gemini CLI OpenCode
Run in your terminal
claude plugin install exa@claude-plugins-official Copy Add to ~/.cursor/mcp.json
{
"mcpServers": {
"exa": {
"url": "https://mcp.exa.ai/mcp"
}
}
} Copy Open in your browser, then install the Exa plugin
https://chatgpt.com/plugins/exa Copy Add to .vscode/mcp.json
{
"servers": {
"exa": {
"type": "http",
"url": "https://mcp.exa.ai/mcp"
}
}
} Copy In Devin, open Customize, then MCPs, and add a custom HTTP server with this URL
https://mcp.exa.ai/mcp Copy Add to ~/.config/devin/mcp_config.json
{
"mcpServers": {
"exa": {
"serverUrl": "https://mcp.exa.ai/mcp"
}
}
} Copy Add to ~/.gemini/settings.json
{
"mcpServers": {
"exa": {
"httpUrl": "https://mcp.exa.ai/mcp"
}
}
} Copy Add to opencode.json
{
"mcp": {
"exa": {
"type": "remote",
"url": "https://mcp.exa.ai/mcp"
}
}
} Copy