syncfusion-javascript-rich-text-editor
Implementing Syncfusion Rich Text Editor
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.
Editor Mode Decision Guide
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
When to Use This Skill
Use this skill when the user needs to:
- Build a rich text / WYSIWYG editor for blog posts, comments, emails, CMS content
- Build a markdown editor with live preview for documentation, note-taking, developer tools
- Customize the toolbar — add/remove items, change layout, add custom tools
- Insert media — images, audio, video, file browser integration
- Enable smart editing — @mention, slash commands, emoji picker, mail merge
- Add AI writing assistance to the editor
- Handle editor value — get/set HTML or markdown content, auto-save, character count
- Work with tables and links inside the editor
- Configure validation — form integration, XHTML validation, read-only mode
- Style or theme the editor — fonts, colors, CSS customization
- Import/export content — Word/PDF/Markdown import and export
Trigger keywords: RichTextEditor, MarkdownEditor, editorMode, WYSIWYG, rich text, markdown editor, content editor, text formatting, ej2-richtexteditor, HtmlEditor, inline editor, iframe editor
Navigation Guide
Getting Started
📄 Read: references/getting-started.md
- Package installation and CSS imports
- Module injection (HtmlEditor vs MarkdownEditor)
- HTML editor initialization
- Markdown editor initialization
- Toolbar configuration at setup
- Feature module reference table
Editor Modes & Types
📄 Read: references/editor-modes.md
- HTML mode vs Markdown mode decision
- Iframe editor (style-isolated editing)
- Inline editing (toolbar appears on selection)
- Resizable editor
- editorMode API and switching modes
Toolbar Configuration
📄 Read: references/toolbar.md
- Toolbar types: Expand, MultiRow, Scrollable, Popup
- Toolbar position: Top / Bottom
- Sticky (floating) toolbar
- Quick toolbars for image, link, table, audio, video, text
- Separator usage (
|and-)
Tools (Built-in & Custom)
📄 Read: references/tools.md
- Complete built-in tools catalog (text, font, alignment, lists, etc.)
- Adding and removing toolbar tools
- Creating custom toolbar commands
- Enabling / disabling toolbar items programmatically
- Text formatting, styling, fullscreen tools
Editor Value (Get/Set/Save)
📄 Read: references/editor-value.md
- Set initial content with
value/valueTemplate - Get HTML content:
editor.value,getHtml(),getText() - Change events and auto-save (
saveInterval) - Character count and max length
- Encoded HTML output (
enableHtmlEncode) - Source code editing (SourceCode tool)
- Placeholder text
Insert Image & Media
📄 Read: references/insert-image-media.md
- Insert images (URL, upload, drag-drop)
- Insert audio and video
- File browser integration
- Upload configuration (server upload, rename)
- Image/media quick toolbar
Tables
📄 Read: references/table.md
- Creating tables (toolbar, programmatic)
- Table quick toolbar operations
- Cell properties, alignment, merge/split
- Table style customization
Links
📄 Read: references/link.md
- Insert hyperlinks
- Link quick toolbar (Open, Edit, Remove)
- Auto-linking URLs
Smart Editing
📄 Read: references/smart-editing.md
- @mention integration
- Slash menu / slash commands
- Emoji picker
- Mail merge with dynamic placeholders
AI Assistant
📄 Read: references/ai-assistant.md
- Integrating AI assistant panel
- AI assistant properties and configuration
- Customizing AI suggestions UI
Markdown-Specific Features
📄 Read: references/markdown-features.md
- Supported markdown syntax (headings, lists, bold, italic, etc.)
- Custom markdown format definitions
- Live markdown preview (split-pane)
- Insert image / table in markdown mode
- Mention support in markdown mode
- Toolbar items specific to markdown
Content Operations
📄 Read: references/content-operations.md
- Code block support
- Text selection API
- Clipboard cleanup
- Paste cleanup (Word paste, HTML cleanup)
- Undo/redo configuration
- Execute command programmatically (
executeCommand) - Enter key configuration (P, BR, DIV)
Import & Export
📄 Read: references/import-export.md
- Import Word/HTML documents into the editor
- Export editor content to Word / PDF
- Markdown import/export
Style & Appearance
📄 Read: references/style-appearance.md
- CSS customization and
cssClass - Style encapsulation
- Adding custom Google fonts
- Spell and grammar check
- Globalization (RTL, localization)
- Tailwind CSS preflight workarounds
- Default font configuration
- Placeholder text styling
Validation & Security
📄 Read: references/validation-security.md
- HTML form integration with RTE
- XHTML validation and XSS prevention
- Read-only mode
How-To Scenarios
📄 Read: references/how-to.md
- RTE inside Dialog
- RTE inside Tab control
- File attachment support
- File size restrictions
- Format code blocks
- Custom shortcut keys
- Save functionality
- Cursor position control
- Rename images on server
Properties Reference
📄 Read: references/properties.md
- Complete list of all
RichTextEditorproperties with types, defaults, and descriptions - Sub-type details for complex model properties (toolbar, image, table, font, color, AI assistant, etc.)
- Code examples for key properties
Methods Reference
📄 Read: references/methods.md
- Complete list of all public instance methods with signatures and return types
- Parameter details and usage examples
executeCommandwith fullCommandNameenum and argument interfaces- Static
Injectmethod and available module list
Events Reference
📄 Read: references/events.md
- Complete list of all component events with types and event argument details
- Lifecycle events:
created,destroyed,blur,focus,change - Upload events for images, audio, and video
- AI Assistant events:
aiAssistantPromptRequest,aiAssistantToolbarClick,aiAssistantStopRespondingClick - Toolbar, popup, dialog, quick toolbar, resize, and selection events
Quick Start
HTML Editor (WYSIWYG)
import { 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';
Markdown Editor
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');
Common Patterns
Get editor value on form submit
const form = document.getElementById('myForm');
form.addEventListener('submit', () => {
const content = editor.value; // HTML string or Markdown string
console.log(content);
});
Auto-save content
const editor = new RichTextEditor({
saveInterval: 5000, // save every 5 seconds of inactivity
change: (args) => {
localStorage.setItem('draft', args.value);
}
});
Read-only mode
editor.readonly = true;
Programmatically set content
editor.value = '<p>New content</p>';
editor.dataBind(); // apply the change
Module Injection Reference
| 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(...).
More from syncfusion/javascript-ui-controls-skills
syncfusion-javascript-gantt-chart
Implement Syncfusion Gantt Chart using JavaScript/TypeScript (Essential JS 2). Use this when working with ej2-gantt component for project scheduling, task dependencies, and timeline management. Covers full Gantt implementation including data binding, task scheduling, columns, resources, timeline configuration, WBS, resource view, critical path, baseline tracking, filtering, sorting, editing, and export functionality (Excel/PDF).
9syncfusion-javascript-maps
Guide to implementing Syncfusion Maps in TypeScript and JavaScript. Use this skill whenever the user needs to create interactive maps, add markers, visualize geographical data, work with map layers, apply color mapping, add annotations, configure legends, or handle map interactions and events. Works with TypeScript (module-based) and JavaScript (CDN/ES5).
8syncfusion-javascript-accumulation-chart
Implements Syncfusion JavaScript accumulation charts (Pie, Doughnut, Funnel, Pyramid) for proportional and percentage-based visualizations. Use when displaying categorical or proportional data. Covers legend and label configuration, interactivity, accessibility, and customization. Works with TypeScript (modules) and JavaScript (CDN/ES5).
8syncfusion-javascript-chart
Implements Syncfusion JavaScript chart controls (Line, Area, Bar, Column, Pie, Polar, Radar, Waterfall, Stock). Use when building interactive data visualizations, dashboards, or real-time charts. Covers series and axes configuration, styling, animations, exporting, and technical indicators. Works with TypeScript (webpack/modules) and JavaScript (CDN/ES5).
8syncfusion-javascript-dropdowns
Comprehensive guide for implementing Syncfusion TypeScript dropdown components including AutoComplete, ComboBox, Mention, Dropdownlist and Multiselect. Use this when building selection interfaces, data binding, filtering, cascading dropdowns, custom templates, and accessible dropdown experiences.
7syncfusion-javascript-dropdowntree
Implement Syncfusion Dropdown Tree control to display hierarchical data in dropdown format. Use this skill when implementing single or multiple value selection from hierarchical data, enabling checkboxes with dependent parent-child states, lazy-loading large datasets, customizing tree items with templates, and configuring multi-language support. Comprehensive coverage of properties, methods, events, data binding modes, checkbox selection, templates, and accessibility features.
7