Skip to content

v1.0.0 · MIT licensed · 0 runtime dependencies

The zero-dependency Markdown editor for React

Split-view live preview, GitHub-style alerts, tabbed code groups, smart tables and a security-hardened renderer in one tiny, SSR-safe, TypeScript-first package.

npm install react-markdown-studio
You type
> [!NOTE]
> Everything you type renders live.

## Why teams pick it

- [x] Zero runtime dependencies
- [x] Accessible, keyboard-first toolbar
- [x] Safe to render untrusted Markdown
- [ ] Your next feature here

Use **bold**, *italic* and `code` freely.
You get
Note

Everything you type renders live.

Why teams pick it
  • Zero runtime dependencies
  • Accessible, keyboard-first toolbar
  • Safe to render untrusted Markdown
  • Your next feature here

Use bold, italic and code freely.

Total downloads
npm, all time
Downloads, last 30 days
npm registry
GitHub stars
AKASHNEGI-github/react-markdown-studio
Site visits
page views, no cookies
  • 0 runtime dependencies
  • 239 automated tests
  • 109 kB npm tarball (ESM + CJS + types)
  • TypeScript first, SSR-safe core

Playground

Try the real editor, right here

This is the actual component from the package, not a recording. Type, use the toolbar and shortcuts, tick a task in the preview, switch modes, export a file.

Welcome to React Markdown Studio

This is the real component, not a screenshot. Edit anything on the left; the preview updates on the right.

Tip

Try Ctrl+B, press Tab inside a list, or paste a URL over some selected text.

Formatting

Write italic, bold, strikethrough, underline, inline code, H2O and E = mc2. Bare links such as https://github.com/AKASHNEGI-github/react-markdown-studio become clickable automatically.

Lists and tasks
  1. Install the package
  2. Import the editor
    • Nested bullets just work
    • Tab and Shift+Tab indent and outdent
  3. Ship it
  • Live preview
  • Clickable task lists (tick one in the preview!)
  • Your idea here
Tables
FeatureStatusNotes
AlignmentYesleft, centre, right
ToolsYesclick inside a table
Code
npm install react-markdown-studio
App.tsx
import { MarkdownEditor } from "react-markdown-studio";
import "react-markdown-studio/styles.css";

export default function App() {
  return <MarkdownEditor defaultValue="# Hello" />;
}
Warning

Raw HTML is never executed. Only a few safe tags (<u>, <sub>, <sup>, <details>) are understood.

Why is it safe to render untrusted Markdown?

Link schemes are checked against an allow-list, raw HTML is shown as text, and parsing is linear-time and depth-limited, so hostile input cannot hang or crash the page.


Made by Akash Negi. MIT licensed.

Ln 1, Col 1246 words1,782 characters2 min read

Tip: Ctrl+B bolds, Tab nests list items, and pasting a URL over selected text makes a link. Everything runs in your browser; nothing is uploaded.

Features

Everything a Markdown editor should have

A complete writing experience without a pile of plugins. All of it ships in one package with no runtime dependencies.

  • Live split preview

    Write on the left, see the result on the right. Edit, split, preview and HTML-source modes, with synchronised scrolling and a responsive mobile layout.

  • Rich formatting toolbar

    Bold, italic, headings, lists, links, images, quotes, tables and more, all from the toolbar or the keyboard. Every button is also a plain, tested function you can reuse.

  • GitHub-style alerts

    NOTE, TIP, IMPORTANT, WARNING and CAUTION callouts with the same syntax GitHub uses, so your documents render identically in both places.

  • Collapsible sections

    Dropdown details blocks that can contain any Markdown, including lists, tables and code. Add open to start expanded.

  • Tabbed code groups

    Show the same snippet for npm, pnpm and yarn as tabs with one block of Markdown. Every code block gets a title bar and a copy button.

  • Smart tables

    Column alignment, and a context toolbar that appears when your cursor is inside a table: insert and delete rows and columns, change alignment.

  • Interactive task lists

    Readers can tick checkboxes in the preview and your Markdown source updates automatically. Perfect for notes, plans and issue templates.

  • Built-in syntax highlighting

    Nineteen languages highlighted by a small built-in engine, so there is no highlight.js or Prism to install, and you can plug in your own highlighter.

  • Export anywhere

    Print to PDF, download the Markdown, or download a complete standalone HTML page with an embedded stylesheet and working tabs.

  • Security-hardened

    Scheme-allow-listed links, no raw HTML execution, linear-time parsing and depth limits: hostile input cannot hang or crash it. Strict-CSP mode included.

  • SSR-safe core

    The parser and HTML renderer run on the server with no DOM. Render Markdown in Next.js, Remix or plain Node, and hydrate the editor on the client.

  • Themeable

    Light, dark and auto modes out of the box, and every colour is a CSS variable, so matching your brand takes a few lines of CSS.

  • Keyboard-first and accessible

    Familiar shortcuts, Tab to indent lists, Enter to continue them, and an ARIA toolbar that is a single tab stop with arrow-key navigation.

  • Paste and drop images

    Provide an upload function and pasted or dropped images become hosted links with a live placeholder. Without one, nothing is ever embedded or sent.

  • Smart paste

    Paste a URL over selected text to turn it into a link instantly, and press Enter inside a list or quote to continue it.

  • Fast on big documents

    The preview renders off the typing path with deferred updates, and the parser is linear-time, so long documents stay responsive.

  • Zero dependencies

    Nothing to audit, nothing to keep patched, nothing that can break your install. React is the only peer dependency.

Markdown commands

Every feature, and the Markdown that triggers it

Type the syntax, or use the toolbar button and shortcut. Each example below is rendered live by the same parser the editor uses, so what you see is exactly what you get.

26 features

Bold

CtrlB

Make text stand out.

You type
**bold text**
You get

bold text

Italic

CtrlI

Emphasise text. _underscores_ work too.

You type
*italic text*
You get

italic text

Bold and italic

Combine both; toggling one never drops the other.

You type
***bold and italic***
You get

bold and italic

Strikethrough

CtrlShiftX

Cross out text.

You type
~~no longer true~~
You get

no longer true

Underline

CtrlU

Underline text using the one HTML tag that renders.

You type
<u>underlined</u>
You get

underlined

Subscript

Lower the baseline, as in chemical formulas.

You type
H<sub>2</sub>O
You get

H2O

Superscript

Raise the baseline, as in exponents.

You type
E = mc<sup>2</sup>
You get

E = mc2

Inline code

CtrlE

Monospace for identifiers and short snippets.

You type
Run `npm install` first.
You get

Run npm install first.

Escaping

A backslash shows a special character literally.

You type
\*not italic\*
You get

*not italic*

Line break

End a line with two spaces or a backslash to break without starting a new paragraph.

You type
first line\
second line
You get

first line
second line

Headings

Ctrl1 / 2 / 3

One to six # characters set the level. Each heading gets a linkable anchor.

You type
# Heading 1
## Heading 2
### Heading 3
You get

Heading 1

Heading 2
Heading 3

Underlined headings

Underline a line with = or - for a level 1 or 2 heading.

You type
Title
=====

Subtitle
--------
You get

Title

Subtitle

Horizontal rule

A thematic break between sections.

You type
---
You get

Blockquote

CtrlShift.

Quote a passage. Press Enter to continue the quote.

You type
> Simplicity is the ultimate sophistication.
> Leonardo da Vinci
You get

Simplicity is the ultimate sophistication. Leonardo da Vinci

Table

Pipes separate columns; colons in the divider row set alignment. Click inside a table for row and column tools.

You type
| Left | Center | Right |
| :--- | :----: | ----: |
| a    |   b    |     c |
| d    |   e    |     f |
You get
LeftCenterRight
abc
def

Bulleted list

CtrlShift8

Use -, * or +. Tab and Shift+Tab nest and un-nest items; Enter continues the list.

You type
- First
- Second
  - Nested
You get
  • First
  • Second
    • Nested

Numbered list

CtrlShift7

Numbers continue automatically, and Tab nests under the correct indentation.

You type
1. First
2. Second
   1. Nested
You get
  1. First
  2. Second
    1. Nested

Task list

CtrlShift9

Checkboxes you can click in the preview, which updates your Markdown.

You type
- [x] Write the docs
- [ ] Ship the release
You get
  • Write the docs
  • Ship the release

Code block

Fence code with three backticks and a language for syntax highlighting. Every block has a copy button.

You type
```ts
const answer: number = 42;
```
You get
const answer: number = 42;

Code block title

Add a title in square brackets after the language.

You type
```ts [greet.ts]
export const greet = (name: string) => `Hello, ${name}!`;
```
You get
greet.ts
export const greet = (name: string) => `Hello, ${name}!`;

Tabbed code group

Show the same snippet for several tools as tabs. Each fence's title becomes its tab.

You type
::: code-group
```bash [npm]
npm install react-markdown-studio
```
```bash [pnpm]
pnpm add react-markdown-studio
```
```bash [yarn]
yarn add react-markdown-studio
```
:::
You get
npm install react-markdown-studio

Image

Like a link with a leading !. Pass onImageUpload to paste or drop images straight into the editor.

You type
![Logo](./logo.svg "Optional title")
You get

Logo

Alerts

GitHub-style callouts: NOTE, TIP, IMPORTANT, WARNING and CAUTION.

You type
> [!NOTE]
> Useful background information.

> [!WARNING]
> Urgent: avoid doing this.
You get
Note

Useful background information.

Warning

Urgent: avoid doing this.

Collapsible section

A dropdown that hides detail until it is opened. Add open to start expanded.

You type
<details>
<summary>Click to expand</summary>

Hidden until you ask for it.

</details>
You get
Click to expand

Hidden until you ask for it.

Keyboard shortcuts

On macOS, use ⌘ in place of Ctrl.

ActionShortcut
BoldCtrlB
ItalicCtrlI
UnderlineCtrlU
StrikethroughCtrlShiftX
Inline codeCtrlE
Insert linkCtrlK
UndoCtrlZ
RedoCtrlShiftZ or CtrlY
Heading 1Ctrl1
Heading 2Ctrl2
Heading 3Ctrl3
Numbered listCtrlShift7
Bulleted listCtrlShift8
Task listCtrlShift9
BlockquoteCtrlShift.
Indent / nest list itemTab
Outdent list itemShiftTab
Continue list or quoteEnter

Get started

Install in one line, render in three

React 18 and 19 are supported. Import the stylesheet once and you are done.

npm install react-markdown-studio
import { useState } from "react";
import { MarkdownEditor } from "react-markdown-studio";
import "react-markdown-studio/styles.css";

export default function Notes() {
  const [markdown, setMarkdown] = useState("# Hello");
  return <MarkdownEditor value={markdown} onChange={setMarkdown} height="480px" />;
}

Full prop and method reference in the API docs. Upgrading from akash-negi-markdown-editor? See the migration guide.

Theming

Make it yours with CSS variables

Light, dark and auto are built in. Everything else is a variable on the editor's root, with no build step and no theme object.

Your brand, your colours

Every colour is a CSS variable, so a theme is a handful of lines.

Tip

Alerts, code, tables and links all follow the variables below.

TokenRole
--rmds-accentLinks and focus
--rmds-bgSurface
const theme = "yours";
CSS
/* Defaults follow light/dark automatically.
   Override any --rmds-* variable to customise. */

Compare

How it sits next to the alternatives

Different tools suit different jobs. These are measured facts from the npm registry, not a verdict. WYSIWYG editors trade size and dependencies for rich-text editing; this is a source-plus-preview editor, like GitHub's, where you always see and control the Markdown.

PackageEditing styleRuntime dependenciesUnpacked sizeLast updated
react-markdown-studioSource + preview0616 KBNov 2026
@uiw/react-md-editorSource + preview44.2 MBNov 2026
@mdxeditor/editorWYSIWYG57644 KBNov 2026
@milkdown/crepeWYSIWYG173.3 MBOct 2026
react-markdown-editor-liteSource + preview3483 KBJan 2026
react-mdeSource + preview0602 KBJun 2022
react-simplemde-editorSource + preview1565 KBOct 2022

Snapshot of the public npm registry, 4 November 2026. Sizes are the published tarball unpacked and exclude dependencies; this package ships ESM, CommonJS and type definitions.

FAQ

Frequently asked questions

Short, honest answers to what people ask before adopting a Markdown editor.

What is React Markdown Studio?

React Markdown Studio is a zero-dependency Markdown editor and renderer for React. It gives you a toolbar, keyboard shortcuts, undo and redo, a live split-view preview, GitHub-style alerts, tabbed code groups, tables, task lists and syntax highlighting in a single npm package.

How is it different from react-markdown?

react-markdown is a renderer: it turns a Markdown string into React elements. React Markdown Studio includes a complete editor interface (toolbar, shortcuts, history, split preview, export) as well as a renderer (the MarkdownViewer component and the markdownToHtml function), with no runtime dependencies. Choose a renderer-only library if you just need to display Markdown and want its plugin ecosystem.

Does it work with Next.js and server-side rendering?

Yes. The parser and HTML renderer in react-markdown-studio/core need no DOM and run in Node, route handlers, Server Components and edge functions. The editor and viewer are client components marked with the use client directive, and they render safely on the server before hydrating.

Is it safe to render Markdown written by users?

It is designed for untrusted input: link schemes are limited to http, https and mailto, raw HTML is never executed (only u, sub, sup and details tags are recognised), parsing runs in linear time with depth limits so hostile input cannot hang or crash it, and a strict Content-Security-Policy mode is available. No software can promise absolute security, so please read the security policy and report any issue privately.

Which React versions are supported?

React 18 and React 19. The full test suite, including component and server-rendering tests, runs against both in continuous integration.

Can I use it in a commercial project?

Yes. React Markdown Studio is released under the MIT license, which allows personal and commercial use.

How do I add image uploads?

Pass an onImageUpload function to the editor. When a user pastes or drops an image, the editor shows an uploading placeholder, calls your function with the file, and replaces the placeholder with the Markdown image link you return. Without that prop, images are never embedded or sent anywhere.

Can I change the colours and styling?

Yes. There are built-in light, dark and auto themes, and every colour is a CSS custom property starting with --rmds-, so matching your brand takes a few lines of CSS with no build step.

Which languages does syntax highlighting support?

A small built-in engine highlights JavaScript, TypeScript and TSX, Python, Bash, JSON, YAML, HTML, CSS, SQL, Go, Rust, Java, C, C++, C#, PHP, Diff and Markdown, plus plain text. You can also plug in your own highlighter.

Is it a WYSIWYG editor?

No. It is a source-plus-preview editor, like GitHub's: you write real Markdown on one side and see the rendered result on the other, so you always control exactly what is saved.