rich-editor Component
Rich Editor System
A powerful WYSIWYG editor with comprehensive formatting tools, media insertion, and customizable toolbar options. Features multiple variants from minimal to full-featured, supporting rich text editing with real-time preview.
Minimal Editor
This is a minimal rich text editor with basic formatting tools.
Standard Editor
Welcome to the Rich Text Editor
This is a standard rich text editor with comprehensive formatting tools including:
- Text formatting (bold, italic, underline, strikethrough)
- Paragraph alignment options
- Lists and indentation
- Links and images
Full Featured Editor
Full Editor
Full-Featured Rich Text Editor
This is a comprehensive rich text editor with all formatting tools including:
- Text formatting: Bold, italic, underline, strikethrough, subscript, superscript
- Colors: Text color and highlight color
- Paragraph: Headings, alignment, lists, indentation
- Media: Links, images, tables
- Advanced: Source view, fullscreen mode
The full editor provides maximum flexibility for content creation.
Editor Themes
Dark Theme Editor
This editor features a dark theme with a focused set of tools for distraction-free writing.
Inline Editor
Click on the text below to edit it inline:
This is an inline editor. Click anywhere in this text to start editing. The toolbar will appear when you select text.
Editor with Custom Actions
Custom Action Buttons
This editor demonstrates custom toolbar styling and action buttons.
Compact Editor
Compact editor for limited space.
Usage Examples
Basic Implementation
<div class="rich-editor minimal">
<div class="toolbar">
<div class="toolbar-group">
<button class="toolbar-btn" data-command="bold">
<i class="icon bold w-4 h-4"></i>
</button>
<button class="toolbar-btn" data-command="italic">
<i class="icon italic w-4 h-4"></i>
</button>
</div>
</div>
<div class="editor-content" contenteditable="true">
Your content here...
</div>
</div>
JavaScript Initialization
// Initialize all rich editors on page
document.addEventListener('DOMContentLoaded', function() {
RichEditor.init();
});
// Initialize specific editor
const editor = document.querySelector('.rich-editor');
RichEditor.initEditor(editor);
// Custom command execution
document.execCommand('bold', false, null);
document.execCommand('createLink', false, 'https://example.com');