Tabs

The Tabs is a tab strip used to switch between pages or views. This widget is included in the TabPanel widget, but you can use the Tabs separately as well.

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

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

  • jQuery

    HTML
    JavaScript
    <div id="tabs"></div>
    var tabs = [
        { text: "User", icon: "user" },
        { text: "Comment", icon: "comment" },
        { text: "Find", icon: "find", badge: "new" }
    ];
    $(function () {
        $("#tabs").dxTabs({
            items: tabs
        });
    });
  • Angular

    HTML
    JavaScript
    <dx-tabs [items]="tabs"></dx-tabs>
    export class AppComponent {
        tabs = [
            // ...   
        ];
    }
  • AngularJS

    HTML
    JavaScript
    <div ng-controller="DemoController">
        <div dx-tabs="{
            items: tabs
        }"></div>
    </div>
    angular.module('DemoApp', ['dx'])
        .controller("DemoController", function ($scope) {
            $scope.tabs = [
                // ...   
            ];
        });
  • Knockout

    HTML
    JavaScript
    <div data-bind="dxTabs: {
        items: tabs
    }"></div>
    var viewModel = {
        tabs: [
            // ...
        ]
    };
    ko.applyBindings(viewModel);
  • ASP.NET MVC Wrappers

    Razor C#
    Razor VB
    @(Html.DevExtreme().Tabs()
        .ID("tabs")
        .Items(items => {
            items.Add().Text("User").Icon("user");
            items.Add().Text("Comment").Icon("comment");
            items.Add().Text("Find").Icon("find").Badge("new");
        })
    )
    @(Html.DevExtreme().Tabs() _
        .ID("tabs") _
        .Items(Sub(items)
            items.Add().Text("User").Icon("user")
            items.Add().Text("Comment").Icon("comment")
            items.Add().Text("Find").Icon("find").Badge("new")
        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

See Also
Show Example:
AngularJS
Knockout
jQuery

Configuration

An object defining configuration options for the Tabs widget.

Methods

This section describes members used to manipulate the widget.

Events

This section describes events fired by this widget.

Default Item Template

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

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