Having trouble getting help?
Contact Support
Contact Support
Integrating Rich Text Editor in Tab Control
22 Mar 20253 minutes to read
Integrating a Rich Text Editor within Tab control provides a versatile and organized user interface for text formatting and content creation across multiple tabs. Each tab instance includes a dedicated editor instance configured with extensive toolbar options, enabling users to effortlessly manipulate text styles, apply formatting, insert media, and manage content layout.
import {
RichTextEditor,
Toolbar,
Link,
Image,
HtmlEditor,
QuickToolbar,
} from '@syncfusion/ej2-richtexteditor';
RichTextEditor.Inject(Toolbar, Link, Image, HtmlEditor, QuickToolbar);
import { Tab } from '@syncfusion/ej2-navigations';
let tabObj: Tab = new Tab({
items: [
{ header: { text: 'Tab 1' }, content: '#tab1Content' },
{ header: { text: 'Tab 2' }, content: '#tab2Content' },
{ header: { text: 'Tab 3' }, content: '#tab3Content' },
],
});
tabObj.appendTo('#element');
let editor1: RichTextEditor = new RichTextEditor({});
editor1.appendTo('#tab1Content');
let editor2: RichTextEditor = new RichTextEditor({});
editor2.appendTo('#tab2Content');
let editor3: RichTextEditor = new RichTextEditor({});
editor3.appendTo('#tab3Content');
<!DOCTYPE html>
<html lang="en">
<head>
<title>Essential JS 2 Rich Text Editor</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="Typescript UI Controls" />
<meta name="author" content="Syncfusion" />
<link href="index.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.1.33/ej2-base/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.1.33/ej2-richtexteditor/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.1.33/ej2-inputs/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.1.33/ej2-lists/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.1.33/ej2-navigations/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.1.33/ej2-popups/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.1.33/ej2-buttons/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.1.33/ej2-splitbuttons/styles/material.css" rel="stylesheet" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.38/system.js"></script>
<script src="systemjs.config.js"></script>
<script src="https://cdn.syncfusion.com/ej2/syncfusion-helper.js" type ="text/javascript"></script>
</head>
<body>
<div id='loader'>Loading....</div>
<div id="container">
<div id="element"></div>
<div id="tab1Content" style="display: none"></div>
<div id="tab2Content" style="display: none"></div>
<div id="tab3Content" style="display: none"></div>
</div>
</body>
</html>