A tab strip used to switch between pages.

Included in: dx.phonejs.js, dx.webappjs.js, dx.all.js

The dxTabs widget displays items that perform an action when clicked.

This widget, like any other DevExtreme UI widget, can be created using one of three possible approaches: jQuery, Knockout or AngularJS. The following code demonstrates how to create the dxTabs widget using the Knockout approach.

<div data-bind="dxTabs:{dataSource: tabs, itemClickAction: tabClicked}"></div>

The tabs are loaded from an array specified by the dataSource configuration option. You can specify an array of objects as the widget data source.

var tabs = [
    { text: "user", icon: "user" },
    { text: "comment", icon: "comment" },
    { text: "find", icon: "find"}

You can use the icons from the built-in icon library. For this purpose, specify the icon field in the widget data source (see the example above). Alternatively, you can set external icons using the iconSrc field of the widget data source, as shown in the following example.

var navItems = [
        { text: "user", iconSrc: "images/icons/user.png" },
        { text: "find", iconSrc: "images/icons/find.png" },

To display widget items, a default template is applied based on the following fields of the data source item objects.

  • disabled
    Specifies whether or not the widget item is disabled.
  • visible
    Specifies whether or not the widget item is visible.
  • html
    Specifies the html code inserted into the item element.
  • text
    Specifies the text inserted into the item element.
  • icon
    Specifies the name of the icon displayed by the widget item.
  • iconsrc
    Specifies a URL pointing to the image to be displayed by the widget item.

To learn more about the fields used in the default item template, refer to the Default Item Template reference section of the widget.

You can introduce a custom template for the widget's items.To do this, add a div element with the data-options attribute set to dxTemplate. Assign item to the template name. In this instance, the template will be applied automatically. See the Customize Widget Item Appearance topic to learn more about templates.

Declare a function that processes a tab click and assign it to the itemClickAction configuration option.

var tabClicked = function(e){
    alert(e.itemData.text + " tab clicked");

Note that you can access the clicked item fields via the itemData field of the object passed as an argument to the itemClickAction function.\

See Also
  • To learn how to create widgets in detail, refer to the Create a Widget article.
  • The dxTabs widget is related to the Collection Containers category. So read an overview of the features that are common for collection container widgets in the Common Tasks topic of the Collection Containers article.
Show Example:


An object defining configuration options for the dxTabs widget.


This section describes members used to manipulate the widget.


This section describes events fired by this component.

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 items of DevExtreme collection widgets. This template is based on certain fields of the data source provided for a widget. Below is the list of the fields that take part in a default item template for the dxTabs widget. 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. For details refer to the Customize Widget Item Appearance topic.