Load tab items dynamically in EJ2 TypeScript Tab control

4 Jan 202510 minutes to read

You can add tabs dynamically to the Tab control by passing an array of items and an index value to the addTab method. Here’s how you can do it:

// Fetch new tab title and content from input elements
let tabTitle: string = document.getElementById('tab-title').value;
let content: string = document.getElementById('tab-content').value;

// Create a tab item object using the input values
let item: Object = { 
    header: { text: tabTitle }, 
    content: createElement('pre', { innerHTML: content.replace(/\n/g, '<br>\n') }).outerHTML 
};

// Add the new tab at the specified index
tabObj.addTab([item], index);

In the following example, we’ll demonstrate how to add tabs dynamically:

  1. A “+” icon is added to the tab header using the iconCss property.
  2. When you click the “+” icon, you can enter the new tab’s heading and content in the provided text boxes.
  3. Clicking the ‘Add Tab’ button will create a new tab with the entered details.
  4. The new tab is appended at the end of the existing tabs.
import { enableRipple, createElement } from '@syncfusion/ej2-base';
import { Tab, SelectEventArgs } from '@syncfusion/ej2-navigations';

enableRipple(true);

let totalItems: number = 0;

let tabObj: Tab = new Tab({
    selected: tabSelected,
    items: [
        {
            header: { 'text': 'Tab1' },
            content: '#tab1_content'
        },
        {
            header: { 'iconCss': 'e-add-icon' },
            content: '#form-container'
        }
    ]
});
tabObj.appendTo('#element');

let addBtn : HTMLElement[] = document.querySelectorAll(".e-ileft.e-icon");
addBtn[0].setAttribute("title", "Add Tab");

function tabSelected(args: SelectEventArgs): void {
    if (args.selectedIndex === document.querySelectorAll('#element .e-toolbar-item').length - 1) {
        document.getElementById('tab-title').value = '';
        document.getElementById('tab-content').value = '';
    }
}

document.getElementById('btn-add').onclick = (e : Event) => {
    let title: string = document.getElementById('tab-title').value;
    let content: string = document.getElementById('tab-content').value;
    let item: Object =  { header: { text: title }, content: createElement('pre', { innerHTML: content.replace(/\n/g, '<br>\n') }).outerHTML };

    totalItems = document.querySelectorAll('#element .e-toolbar-item').length;
    tabObj.addTab([item], totalItems-1);
};
<!DOCTYPE html>
<html lang="en">

<head>
    <title>Essential JS 2 Tab</title>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="description" content="Essential JS 2 Tab" />
    <meta name="author" content="Syncfusion" />
    <link href="https://cdn.syncfusion.com/ej2/28.1.33/material.css" rel="stylesheet" />
    <link href="index.css" rel="stylesheet" />
    <script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.38/system.js"></script>
    <script src="systemjs.config.js"></script>
    <style>
        @font-face {
          font-family: 'Socialicons';
          src: url(data:application/x-font-ttf;charset=utf-8;base64,AAEAAAAKAIAAAwAgT1MvMv1tCfsAAAEoAAAAVmNtYXCnKKeOAAABrAAAAEhnbHlml19XagAAAgwAABhQaGVhZA8dCeEAAADQAAAANmhoZWEIUQQMAAAArAAAACRobXR4LAAAAAAAAYAAAAAsbG9jYR3AIwwAAAH0AAAAGG1heHABIAIAAAABCAAAACBuYW1l0X1q/wAAGlwAAAJVcG9zdGX5D00AABy0AAAAkwABAAAEAAAAAFwEAAAAAAAD9AABAAAAAAAAAAAAAAAAAAAACwABAAAAAQAA+iTiP18PPPUACwQAAAAAANYFYngAAAAA1gVieAAAAAAD9AP0AAAACAACAAAAAAAAAAEAAAALAfQACwAAAAAAAgAAAAoACgAAAP8AAAAAAAAAAQQAAZAABQAAAokCzAAAAI8CiQLMAAAB6wAyAQgAAAIABQMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUGZFZABApwCnCQQAAAAAXAQAAAAAAAABAAAAAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAAAAACAAAAAwAAABQAAwABAAAAFAAEADQAAAAEAAQAAQAApwn//wAApwD//wAAAAEABAAAAAEAAgADAAQABQAGAAcACAAJAAoAAAAAAiQCzgOMBU4F/gZYB9QIcAo+DCgABAAAAAAD0gPzAFUA4gF3AfMAAAEzHwYHFQ8EFR8IPwUfBRUPCCMvFj0BPwoXNw8fHQEfDhUPAT8CHwkzPyA9Ai8iDwIFHwcPIysBLwYjDwI/AS8PNT8oHx4BDxAdAR8PHQEHPwE7AR8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dGVkIHVzaW5nIFN5bmNmdXNpb24gTWV0cm8gU3R1ZGlvd3d3LnN5bmNmdXNpb24uY29tACAAUwBvAGMAaQBhAGwAaQBjAG8AbgBzAFIAZQBnAHUAbABhAHIAUwBvAGMAaQBhAGwAaQBjAG8AbgBzAFMAbwBjAGkAYQBsAGkAYwBvAG4AcwBWAGUAcgBzAGkAbwBuACAAMQAuADAAUwBvAGMAaQBhAGwAaQBjAG8AbgBzAEYAbwBuAHQAIABnAGUAbgBlAHIAYQB0AGUAZAAgAHUAcwBpAG4AZwAgAFMAeQBuAGMAZgB1AHMAaQBvAG4AIABNAGUAdAByAG8AIABTAHQAdQBkAGkAbwB3AHcAdwAuAHMAeQBuAGMAZgB1AHMAaQBvAG4ALgBjAG8AbQAAAAACAAAAAAAAAAoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAsBAgEDAQQBBQEGAQcBCAEJAQoBCwEMAAh3aGF0c2FwcAd0d2l0dGVyBXZpbWVvCWluc3RhZ3JhbQhsaW5rZWRpbghmYWNlYm9vawtnb29nbGUtcGx1cwZ0dW1ibHIIc2t5cGUtMDEIeW91dHViZTEAAAA=) format('truetype');
          font-weight: normal;
          font-style: normal;
        }
    
        .e-add-icon::before {
          content: '\e823';
        }

        .e-content .e-item {
            font-size: 12px;
            margin: 10px;
            text-align: justify;
        }

        .container {
            min-width: 350px;
            max-width: 500px;
            margin: 0 auto;
        }

        #form-container {
            margin: 0 auto;
            max-width: 300px;
        }

        .btn-section {
            text-align: center;
        }

        .add-tab-btn-section td {
            padding: 10px;
        }

        .info {
            font-weight: bold;
        }
    </style>
<script src="https://cdn.syncfusion.com/ej2/syncfusion-helper.js" type ="text/javascript"></script>
</head>
<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="tab1_content" style="display: none">
            <ul>
                <li>Click on the "+" header to add dynamic tab items. </li>
                <li>It displays input elements to get the new tab information. </li>
                <li>Add details and click the "Add Tab" button to open the newly added tab.</li>
            </ul>
        </div>
        <div id="form-container" style="display: none">
            <div class="e-float-input">
                <input type="text" id="tab-title" required="" />
                <span class="e-float-line"></span>
                <label class="e-float-text">Enter header title</label>
            </div>
            <br />
            <div class="e-float-input">
                <textarea rows="5" type="text" id="tab-content" required=""></textarea>
                <span class="e-float-line"></span>
                <label class="e-float-text">Enter content</label>
            </div>
            <br />
            <div class="btn-section">
                <button id="btn-add" class="e-btn">Add Tab</button>
                <br />
                <br />
                <span class="info"> * Title is mandatory to add a new Tab</span>
            </div>
        </div>
        <div id='element'></div>
    </div>
</body>

</html>