A React and TypeScript markdown editor with side-by-side preview and syntax highlighting. It wraps a textarea instead of depending on Monaco, CodeMirror, or similar editors.
Overview
This React component provides markdown editing with an integrated preview pane and toolbar commands. The implementation stays textarea-based, so it avoids heavy embedded code editors while still supporting GitHub-flavored markdown, tab indentation, automatic lists, and optional dark mode.
Headless utilities let you build a custom UI around the same keyboard shortcuts and newline behavior. Toolbars accept custom commands, extra actions, internationalized labels, and filtered command sets; height can follow content with optional drag resize.
Preview can include code highlighting through the default build, a smaller common language subset, or a no-highlight bundle to shrink size. Optional KaTeX math and Mermaid diagram previews are documented, along with Next.js App Router client-only setup and global style imports.
Authors should sanitize untrusted markdown to prevent XSS; the docs recommend adding rehype-sanitize as a plugin when content is not fully trusted.
Key features
- Markdown edit and preview panes
- Textarea-based without Monaco or CodeMirror
- GitHub-flavored markdown support
- Configurable toolbar commands
- Dark mode and Next.js examples
- Headless editor utilities
- Optional KaTeX and Mermaid preview
- Syntax highlighting bundle options
Use cases
- In-app markdown authoring UIs
- Documentation or comment editors
- Custom headless markdown toolbars
- Next.js client-side editing pages
- Markdown content with live preview