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({
});

                    

DevExtreme widgets are integrated with many popular libraries and frameworks. See the Installation section (for JavaScript libraries) or the Prerequisites and Installation section (for ASP.NET MVC framework) to find details on setting up DevExtreme with a particular library or framework.

The following code shows how to create the TabPanel widget using every supported library and framework. For more details on working with widgets in these libraries and frameworks, see the Widget Basics topic for jQuery, Angular, AngularJS, Knockout or ASP.NET MVC.

jQuery
JavaScript
HTML
var tabs = [{
    title: 'Tab 1 Title',
    text: 'Tab 1 Text Content'
}, {
    title: 'Tab 2 Title',
    text: 'Tab 2 Text Content'
}, {
    title: 'Tab 3 Title',
    text: 'Tab 3 Text Content'
}];
$(function () {
    $("#tabPanel").dxTabPanel({
        items: tabs
    });
});
<div id="tabPanel"></div>
Angular
HTML
TypeScript
<dx-tab-panel [items]="tabs"></dx-tab-panel>
import { DxTabPanelModule } from 'devextreme-angular'
// ...
export class AppComponent {
    tabs = [{
        title: 'Tab 1 Title',
        text: 'Tab 1 Text Content'
    }, {
        title: 'Tab 2 Title',
        text: 'Tab 2 Text Content'
    }, {
        title: 'Tab 3 Title',
        text: 'Tab 3 Text Content'
    }];
}
@NgModule({
    imports: [
        // ...
        DxTabPanelModule
    ],
    // ...
})
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 = [{
            title: 'Tab 1 Title',
            text: 'Tab 1 Text Content'
        }, {
            title: 'Tab 2 Title',
            text: 'Tab 2 Text Content'
        }, {
            title: 'Tab 3 Title',
            text: 'Tab 3 Text Content'
        }];
    });
Knockout
HTML
JavaScript
<div data-bind="dxTabPanel: {
    items: tabs
}"></div>
var viewModel = {
    tabs: [{
        title: 'Tab 1 Title',
        text: 'Tab 1 Text Content'
    }, {
        title: 'Tab 2 Title',
        text: 'Tab 2 Text Content'
    }, {
        title: 'Tab 3 Title',
        text: 'Tab 3 Text Content'
    }]
};
ko.applyBindings(viewModel);
ASP.NET MVC Controls
Razor C#
Razor VB
@(Html.DevExtreme().TabPanel()
    .ID("tabPanel")
    .Items(items => {
        items.Add().Title("Tab 1 Title").Text("Tab 1 Text Content");
        items.Add().Title("Tab 2 Title").Text("Tab 2 Text Content");
        items.Add().Title("Tab 3 Title").Text("Tab 3 Text Content");
    })
)
@(Html.DevExtreme().TabPanel() _
    .ID("tabPanel") _
    .Items(Sub(items)
        items.Add().Title("Tab 1 Title").Text("Tab 1 Text Content")
        items.Add().Title("Tab 2 Title").Text("Tab 2 Text Content")
        items.Add().Title("Tab 3 Title").Text("Tab 3 Text Content")
    End Sub)
)

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.

Type:

Object

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