Description

Easily highlight new or unread items by adding tags & pills to links, Bootstrap navs, and more. Vertical Navigation menu items can contain tags and pills in all navigation levels. You can use any color tags and pills with flat or glow effect. Modern Admin horizontal navigation has tag & pills on left side.

Examples

Tags example

Default Primary Success Info Warning Danger

Tags with .badge-pill example

Default Primary Success Info Warning Danger

Tags with .badge-glow & custom background and border color.

Info Warning Danger teal blue grey purple

Tags (as pills)

12 5 8 12 10 15

Tags (as pills) with icons

Tags (as pills) with .badge-glow & custom background and border color.

12 50 2 9 11 100

CSS Classes

Tags

This table contains all classes related to the horizontal navigation with tags option. Tags scale to match the size of the immediate parent element by using relative font sizing and em units.

All these options can be set via following classes:

Classes Description
.badge This is tags basic class must have to add for creating tags.
.badge-pill Use the .badge-pill modifier class to make tags more rounded (with a larger border-radius and additional horizontal padding).
.badge-default badge-default
.badge-default badge-primary
.badge-default badge-success
.badge-default badge-info
.badge-default badge-warning
.badge-default badge-danger
Add any of the mentioned modifier classes to change the appearance of a tag.
.badge-glow Add this class to add glow effect to tags or pills. This is optional class.
.bg-[color]

To set the dark navbar background color use .bg-[color] class where [color] is the value of your selected color from modern color palette. So for teal color background class will be .bg-teal. Refer HTML markup line no 2. Background color class is a optional if you don't it will take white background default.

.bg-darken-[*]

To set the selected background color darken use .bg-darken-[*] class where [*] is the value between '1-5' of your selected darken color from modern color palette. So for color darken 4 background class will be .bg-darken-4. Refer HTML markup line no 2. Background darken color class is a optional if you don't it will take white background default.

.bg-darken-[*] class will work only if you have used .bg-[color].

.border-[color]

To set the dark navbar border color use .border-[color] class where [color] is the value of your selected color from modern color palette. So for teal color border class will be .bg-teal. Refer HTML markup line no 2. Border color class is a optional.

.border-darken-[color]

To set the selected border color darken use .border-darken-[*] class where [*] is the value between '1-5' of your selected darken color from modern color palette. So for color darken 4 border class will be .border-darken-4. Refer HTML markup line no 2. Border darken color class is a optional.

.border-darken-[*] class will work only if you have used .border-[color].

HTML Markup

This section contains HTML Markup to add tags & pils to vertical navigation menu with options.

  • Line no 16 & 22: Contain the <span class="badge badge-default badge-info float-right">1.2.2</span> html code to add tag or badge to the menu items.
          
            <!DOCTYPE html>
            <html lang="en">
            <head></head>
            <body data-open="click" data-menu="horizontal-menu" class="horizontal-layout horizontal-menu 1-column menu-expanded">

              <!-- navbar-static-top-->
              <nav role="navigation" class="header-navbar navbar-expand-sm navbar navbar-with-menu navbar-static-top navbar-dark navbar-shadow navbar-border">
              ...
              </nav>

              <!-- START  Horizontal navigation -->
              <div role="navigation" data-menu="menu-wrapper" class="header-navbar navbar-expand-sm menu-icon-right navbar navbar-horizontal navbar-dark navbar-shadow border-grey border-darken-2">
                <!-- Horizontal menu content-->
                
                <div data-menu="menu-container" class="navbar-container">
                  <ul id="main-menu-navigation1" data-menu="menu-navigation" class="nav navbar-nav">
                    <li class="nav-item"><a href="index.html" class="nav-link"><i class="la la-lock"></i><span> <span class="badge badge-pill badge-default badge-danger">5</span> Dashboard</span></a></li>
                    <li data-menu="dropdown" class="dropdown nav-item"><a href="#" data-toggle="dropdown" class="dropdown-toggle nav-link"><i class="la la-tv"></i><span>My Menu</span></a>
                      <ul class="dropdown-menu">
                        <li class=" navigation-header"><span>Main</span></li>
                        <li data-menu=""><a href="#" data-toggle="dropdown" class="dropdown-item">Second level</a></li>
                        <li data-menu=""><a href="#" data-toggle="dropdown" class="dropdown-item"> <span class="badge badge-glow badge-pill badge-default badge-info">2</span> Second level</a></li>
                        <li data-menu=""><a href="#" data-toggle="dropdown" class="dropdown-item">Second level</a></li>
                        <li data-menu=""><a href="#" data-toggle="dropdown" class="dropdown-item">Second level</a></li>
                        <li data-menu=""><a href="#" data-toggle="dropdown" class="dropdown-item">Second level</a></li>
                        <li data-menu=""><a href="#" data-toggle="dropdown" class="dropdown-item">Second level</a></li>
                        <li data-menu=""><a href="#" data-toggle="dropdown" class="dropdown-item">Second level</a></li>
                        <li data-menu=""><a href="#" data-toggle="dropdown" class="dropdown-item">Second level</a></li>
                        <li data-menu=""><a href="#" data-toggle="dropdown" class="dropdown-item">Second level</a></li>
                        <li data-menu=""><a href="#" data-toggle="dropdown" class="dropdown-item">Second level</a></li>
                        <li data-menu=""><a href="#" data-toggle="dropdown" class="dropdown-item">Second level</a></li>
                        <li data-menu=""><a href="#" data-toggle="dropdown" class="dropdown-item">Second level</a></li>
                        <li data-menu=""><a href="#" data-toggle="dropdown" class="dropdown-item">Second level</a></li>
                        <li data-menu=""><a href="#" data-toggle="dropdown" class="dropdown-item">Second level</a></li>
                        <li data-menu="dropdown-submenu" class="dropdown dropdown-submenu"><a href="#" data-toggle="dropdown" class="dropdown-item dropdown-toggle">Second level with child</a>
                          <ul class="dropdown-menu">
                            <li data-menu=""><a href="#" data-toggle="dropdown" class="dropdown-item">Third level</a></li>
                            <li data-menu="dropdown-submenu" class="dropdown dropdown-submenu"><a href="#" data-toggle="dropdown" class="dropdown-item dropdown-toggle">Third level with child</a>
                              <ul class="dropdown-menu">
                                <li data-menu=""><a href="#" data-toggle="dropdown" class="dropdown-item"> <span class="badge badge-pill badge-default badge-warning">New</span>  Fourth level</a></li>
                                <li data-menu=""><a href="#" data-toggle="dropdown" class="dropdown-item">Fourth level</a></li>
                              </ul>
                            </li>
                          </ul>
                        </li>
                      <li data-menu=""><a href="#" data-toggle="dropdown" class="dropdown-item">Second level</a></li>
                    </ul>
                    </li>
                  </ul>
                </div>
                <!-- /horizontal menu content-->
              </div>
              <!-- END  Horizontal navigation -->

              <!-- BEGIN Content-->
              <div class="content app-content">
              <div class="content-wrapper">
              <!-- content header-->
              <div class="content-header row">
              ...
              </div>
              <!-- content header-->

              <!-- content body-->
              <div class="content-body">
              ...
              </div>
              <!-- content body-->

              </div>
              </div>
              <!-- END Content-->

              <!-- START FOOTER DARK-->
              <footer class="footer footer-dark">
              ...
              </footer>
              <!-- START FOOTER DARK-->

            </body>
            </html>
          
          

PUG Configuration

Modern Admin use PUG as template engine to generate pages and whole template quickly using node js, for getting start with PUG usage & template generating process please refer template documentation.

Menu JSON Configurations
Options Description
tag Add the tag or Badge any text or icon you want to display.
tag custom Configure your tag classes as per your requirements, you can use any classes combination from above CSS Classes table. i.e "badge badge-glow badge-pill badge-default badge-danger"
PUG Code

You need to add tags and pills options to menu JSON object, please read the documentation to customize the menu using PUG.

  • Line no 18 & 24: Contain menu tags and pills JSON configurations options.

Modern Admin use the common menu JSON object to generate same menu on each pages of your template that will save your time by reducing the repetitive menu customization task on each page. This template has menu example pug file for every layouts, Here in below example, it shows horizontal menu layout menu PUG file horizontal-menu.pug, you can use it on template level only it will generate whole template with the same menu options.

                
                    +horizontalMenu([
                    //- Main Navigation Header
                    {navheader:"Main",icon:"la la-ellipsis-h"},

                      //- Dashboard
                      {url:"index.html",name:"Dashboard",slug:"dashboard",icon:"la la-home", tag:"New" , tagcustom: "badge badge-default badge-danger"},

                      //- Layouts Start
                      {url:"#",name:"Layouts",slug:"",icon:"la la-bookmark",
                        //- Layouts Submenu
                        submenu:[
                          {url:"#",name:"Layout 1",slug:"", tag:"2", tagcustom: "badge badge-glow badge-pill bg-teal border-teal border-darken-4"},
                          {url:"#",name:"Layout 2",slug:""},
                          {url:"#",name:"Layout 3",slug:""},
                          {url:"#",name:"Layout 4",slug:""},
                          {url:"#",name:"Layout 5",slug:"",classlist:"disabled",menuSubtitle:"Coming soon"},
                        ]
                      },
                      //- Layouts End
            ]);