NavBar

The NavBar is a widget that navigates the application views.

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

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

  • jQuery

    HTML
    JavaScript
    <div id="navBar"></div>
    $(function () {
        $("#navBar").dxNavBar({
            items: [
                { text: "Home", icon: "home" },
                { text: "About", icon: "info" },
                { text: "favorites", icon: "favorites", badge: "new" }
            ]
        });
    });
  • Angular

    HTML
    <dx-nav-bar>
        <dxi-item text="Home" icon="home"></dxi-item>
        <dxi-item text="About" icon="info"></dxi-item>
        <dxi-item text=favorites" icon=favorites" badge="new"></dxi-item>
    </dx-nav-bar>
  • AngularJS

    HTML
    <div dx-nav-bar="{
        items: [
            { text: 'Home', icon: 'home' },
            { text: 'About', icon: 'info' },
            { text: 'favorites', icon: 'favorites', badge: 'new' }
        ]
    }"></div>
  • Knockout

    HTML
    <div data-bind="dxNavBar: {
        items: [
            { text: 'Home', icon: 'home' },
            { text: 'About', icon: 'info' },
            { text: 'favorites', icon: 'favorites', badge: 'new' }
        ]
    }"></div>
  • ASP.NET MVC Wrappers

    Razor C#
    Razor VB
    @(Html.DevExtreme().NavBar()
        .ID("navBar")
        .Items(items => {
            items.Add().Text("Home").Icon("home");
            items.Add().Text("About").Icon("info");
            items.Add().Text("Favorites").Icon("favorites").Badge("new");
        })
    )
    @(Html.DevExtreme().NavBar() _
        .ID("navBar") _
        .Items(Sub(items)
            items.Add().Text("Home").Icon("home")
            items.Add().Text("About").Icon("info")
            items.Add().Text("Favorites").Icon("favorites").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 NavBar 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 navbar 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 the 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