Getting Started
SynclineMDX Editor is a framework-agnostic, plugin-based MDX editor with 36 built-in plugins, dark mode, accessibility features, and a small gzipped footprint.
Installation
Install the package from npm:
terminal
Quick Start (Vanilla JS)
The createEditor() factory includes all 36 plugins and the default toolbar:
quick-start.js
Selective Plugins
Use the SynclineMDXEditor constructor directly for a lighter setup with only the plugins you need:
editor-selective.ts
React Integration
Use useRef + useEffect to mount the editor in a React component:
MyEditor.tsx
Next.js (App Router)
Mark the component as 'use client' since the editor uses browser APIs. The useEffect ensures it only runs on the client:
app/editor/page.tsx
CDN / No Build Tool
Drop the editor into any HTML page via jsDelivr:
index.html
Configuration Options
All options accepted by createEditor() and the SynclineMDXEditor constructor:
| Option | Type | Required | Description |
|---|---|---|---|
container | HTMLElement | string | Yes | CSS selector or DOM element to mount the editor into. |
value | string | No | Initial markdown/MDX string. Defaults to empty string. |
plugins | EditorPlugin[] | No | Array of plugin objects. createEditor() defaults to allPlugins(). |
toolbar | ToolbarConfig | No | Toolbar layout configuration. createEditor() defaults to defaultToolbar(). |
theme | Record<string, string> | No | CSS custom property overrides, e.g. { "--smdx-primary": "#e03131" }. |
mode | 'split' | 'editor' | 'preview' | No | Initial editor mode. Defaults to 'split'. |
placeholder | string | No | Placeholder text shown when the editor is empty. |
readOnly | boolean | No | Disables editing. Renders content in preview mode. |
scrollSync | boolean | No | Syncs scrolling between editor and preview panes. Defaults to true. |
onChange | (md: string) => void | No | Callback fired on every content change. |
locale | Partial<EditorLocale> | No | Locale overrides for UI strings. |
Next Steps
© 2026 SynclineMDX Editor. All rights reserved.