Implements the Syncfusion Rich Text Editor and Markdown Editor using TypeScript (ej2-richtexteditor). Supports both HTML (WYSIWYG) and Markdown modes via editorMode on a single RichTextEditor class. Use this skill for toolbar setup, image/media/table handling, inline or iframe editing, AI assistant, smart editing, import/export, and all content editor scenarios.
A unified skill for implementing the Syncfusion Rich Text Editor (RTE) and Markdown Editor in TypeScript. Both editors share the same RichTextEditor class and @syncfusion/ej2-richtexteditor package — the only difference is the editorMode property and which feature module you inject.
User wants WYSIWYG / formatted HTML content? → Use
editorMode: 'HTML'(default), injectHtmlEditorUser wants markdown / plain text with preview? → Use
editorMode: 'Markdown', injectMarkdownEditorUser wants iframe isolation? → Add
iframeSettings: { enable: true }to HTML modeUser wants inline editing? → Add
inlineMode: { enable: true }to HTML mode
Use this skill when the user needs to:
Trigger keywords: RichTextEditor, MarkdownEditor, editorMode, WYSIWYG, rich text, markdown editor, content editor, text formatting, ej2-richtexteditor, HtmlEditor, inline editor, iframe editor
📄 Read: references/getting-started.md
📄 Read: references/editor-modes.md
📄 Read: references/toolbar.md
| and -)📄 Read: references/tools.md
📄 Read: references/editor-value.md
value / valueTemplateeditor.value, getHtml(), getText()saveInterval)enableHtmlEncode)📄 Read: references/insert-image-media.md
📄 Read: references/table.md
📄 Read: references/link.md
📄 Read: references/smart-editing.md
📄 Read: references/ai-assistant.md
📄 Read: references/markdown-features.md
📄 Read: references/content-operations.md
executeCommand)📄 Read: references/import-export.md
📄 Read: references/style-appearance.md
cssClass📄 Read: references/how-to.md
📄 Read: references/properties.md
RichTextEditor properties with types, defaults, and descriptions📄 Read: references/methods.md
executeCommand with full CommandName enum and argument interfacesInject method and available module list📄 Read: references/events.md
created, destroyed, blur, focus, changeaiAssistantPromptRequest, aiAssistantToolbarClick, aiAssistantStopRespondingClickimport { RichTextEditor, Toolbar, Link, Image, HtmlEditor, QuickToolbar } from '@syncfusion/ej2-richtexteditor';
RichTextEditor.Inject(Toolbar, Link, Image, HtmlEditor, QuickToolbar);
const editor = new RichTextEditor({
toolbarSettings: {
items: ['Bold', 'Italic', 'Underline', '|', 'Formats', 'Alignments',
'OrderedList', 'UnorderedList', '|', 'CreateLink', 'Image', '|',
'SourceCode', 'Undo', 'Redo']
},
value: '<p>Start editing here...</p>'
});
editor.appendTo('#editor');
<!-- index.html -->
<div id="editor"></div>
/* styles.css */
@import '../node_modules/@syncfusion/ej2-base/styles/tailwind3.css';
@import '../node_modules/@syncfusion/ej2-buttons/styles/tailwind3.css';
@import '../node_modules/@syncfusion/ej2-inputs/styles/tailwind3.css';
@import '../node_modules/@syncfusion/ej2-lists/styles/tailwind3.css';
@import '../node_modules/@syncfusion/ej2-navigations/styles/tailwind3.css';
@import '../node_modules/@syncfusion/ej2-popups/styles/tailwind3.css';
@import '../node_modules/@syncfusion/ej2-splitbuttons/styles/tailwind3.css';
@import '../node_modules/@syncfusion/ej2-richtexteditor/styles/tailwind3.css';
import { RichTextEditor, Toolbar, Link, Image, MarkdownEditor } from '@syncfusion/ej2-richtexteditor';
RichTextEditor.Inject(Toolbar, Link, Image, MarkdownEditor);
const editor = new RichTextEditor({
editorMode: 'Markdown',
toolbarSettings: {
items: ['Bold', 'Italic', 'StrikeThrough', 'InlineCode', '|',
'Formats', 'Blockquote', '|', 'OrderedList', 'UnorderedList',
'CreateLink', 'Image', 'CreateTable', '|', 'Undo', 'Redo']
},
value: '## Hello Markdown\n\nStart writing here...'
});
editor.appendTo('#editor');
const form = document.getElementById('myForm');
form.addEventListener('submit', () => {
const content = editor.value; // HTML string or Markdown string
console.log(content);
});
const editor = new RichTextEditor({
saveInterval: 5000, // save every 5 seconds of inactivity
change: (args) => {
localStorage.setItem('draft', args.value);
}
});
editor.readonly = true;
editor.value = '<p>New content</p>';
editor.dataBind(); // apply the change
| Feature | Module to Inject |
|---|---|
| HTML editing | HtmlEditor |
| Markdown editing | MarkdownEditor |
| Toolbar | Toolbar |
| Hyperlinks | Link |
| Images | Image |
| Audio | Audio |
| Video | Video |
| Tables | Table |
| Quick toolbars | QuickToolbar |
| Paste cleanup | PasteCleanup |
| Character count | Count |
| Resize | Resize |
| File manager | FileManager |
| Mention | Mention (from ej2-dropdowns) |
Inject only what you need — each module adds to bundle size. Always call
RichTextEditor.Inject(...)beforenew RichTextEditor(...).