TabPanel

The TabPanel is a widget consisting of the Tabs and MultiView widgets. It automatically synchronizes the selected tab with the currently displayed view and vice versa.

Included in: dx.mobile.js, dx.web.js, dx.viz-web.js, dx.all.js
Module: ui/tab_panel
Export: default
TabPanel interactive configuration
Copy Code
Copy to Codepen
$("#tabpanel").dxTabPanel({
});

You can create the widget using one of the following approaches.

jQuery
JavaScript
HTML
var tabs = [{
    title: 'Info',
    text: 'This is Info Tab'
}, {
    title: 'Contacts',
    text: 'This is Contacts Tab'
}, {
    title: 'Address',
    text: 'This is Address Tab'
}];
$(function () {
    $("#tabPanel").dxTabPanel({
        items: tabs
    });
});
<div id="tabPanel"></div>
Angular
HTML
JavaScript
<dx-tab-panel [items]="tabs"></dx-tab-panel>
export class AppComponent {
    tabs = [
        // ...
    ];
}
AngularJS
HTML
JavaScript
<div ng-controller="DemoController">
    <div dx-tab-panel="{
        items: tabs
    }"></div>
</div>
angular.module('DemoApp', ['dx'])
    .controller("DemoController", function ($scope) {
        $scope.tabs = [
            // ...   
        ];
    });
Knockout
HTML
JavaScript
<div data-bind="dxTabPanel: {
    items: tabs
}"></div>
var viewModel = {
    tabs: [
        // ...
    ]
};
ko.applyBindings(viewModel);
ASP.NET MVC Controls
Razor C#
Razor VB
@(Html.DevExtreme().TabPanel()
    .ID("tabPanel")
    .Items(items => {
        items.Add().Title("Info").Text("This is Info Tab");
        items.Add().Title("Contacts").Text("This is Contacts Tab");
        items.Add().Title("Address").Text("This is Address Tab");
    })
)
@(Html.DevExtreme().TabPanel() _
    .ID("tabPanel") _
    .Items(Sub(items)
        items.Add().Title("Info").Text("This is Info Tab")
        items.Add().Title("Contacts").Text("This is Contacts Tab")
        items.Add().Title("Address").Text("This is Address Tab")
    End Sub)
)

Note that DevExtreme widgets require you to link the jQuery library to your application. If you use the Knockout or AngularJS approach, the Knockout or AngularJS library is also required. For detailed information on linking these libraries to your project, refer to the topics in the Installation section.

View Demo Watch Video

See Also
Show Example:
AngularJS
Knockout
jQuery

Configuration

An object defining configuration options for the TabPanel widget.

Methods

This section describes members used to manipulate the widget.

Events

This section describes events fired by this widget.

See Also

Default Item Template

This section lists the data source fields that are used in a default template for tab panel items.

By default, a predefined item template is applied to display the items of this widget. This template is based on certain fields of the data source provided for this widget. Below is a list of these fields. If the default item template is not appropriate for your task, implement a custom item template based on these or other fields of your data source.

See Also