Skip to content
Related Articles
Open in App
Not now

Related Articles

Onsen UI CSS Component Basic Tabbar

Improve Article
Save Article
Like Article
  • Last Updated : 03 Jul, 2022
Improve Article
Save Article
Like Article

Onsen UI CSS is used to create beautiful HTML components. It is one of the most efficient ways to create HTML5 hybrid components that are compatible with both mobile and desktop.

Tabbar is used to create the Tabs using Onsen UI classes. Onsen UI CSS Component Basic Tabbar is used to create the tabbar using the below Onsen UI Tabbar classes.

Onsen UI CSS Component Basic Tabbar Classes:

  • tabbar: This class is used to create the tabbar.
  • tabbar__item: This class is used to create the tabbar item.
  • tabbar__button: This class is used to create the tabbar button.
  • tabbar__label: This class is used to create the tabbar label.

Syntax:

<div class="tabbar">
  <label class="tabbar__item">
    <input type="radio" name="...">
    <button class="tabbar__button">
      <div class="tabbar__label">
          ...
      </div>
    </button>
  </label>
   ...
</div>

Example 1: The following example demonstrates the Onsen UI CSS Component Basic Tabbar.

HTML




<!DOCTYPE html>
<html>
  
<head>
    <!-- CDN links of Onsen UI library -->
    <link rel="stylesheet" href=
    <link rel="stylesheet" href=
    <script src=
    </script>
</head>
  
<body>
    <center>
        <h1 style="color: green;">
            GeeksforGeeks
        </h1>
        <h3>
            Onsen UI CSS Component Basic Tabbar
        </h3
        <div class="tabbar">
            <label class="tabbar__item">
                <input type="radio" 
                       name="tabs" 
                       checked="checked">
                <button class="tabbar__button">
                    <div class="tabbar__label">
                        Item 1
                    </div>
                </button>
            </label>
          
            <label class="tabbar__item">
                <input type="radio" 
                       name="tabs">
                <button class="tabbar__button">
                    <div class="tabbar__label">
                        Item 2
                    </div>
                </button>
            </label>
          
            <label class="tabbar__item">
                <input type="radio" 
                       name="tabs">
                <button class="tabbar__button">
                    <div class="tabbar__label">
                        Item 3
                    </div>
                </button>
            </label>
        </div>
    </center>
</body>
</html>


Output:

 

Example 2: The following example demonstrates the Onsen UI CSS Component Basic Tabbar.

HTML




<!DOCTYPE html>
<html>
  
<head>
    <!-- CDN links of Onsen UI library -->
    <link rel="stylesheet" href=
    <link rel="stylesheet" href=
    <script src=
    </script>
</head>
  
<body>
    <center>
        <h1 style="color: green;">
            GeeksforGeeks
        </h1>
        <h3>
            Onsen UI CSS Component Basic Tabbar
        </h3
        <div class="tabbar">
            <label class="tabbar__item">
                <input type="radio" 
                       name="tabs" 
                       checked="checked">
                <button class="tabbar__button">
                    <i class="tabbar__icon 
                              ion-ios-menu">
                    </i>
                </button>
            </label>
          
            <label class="tabbar__item">
                <input type="radio"
                       name="tabs">
                <button class="tabbar__button">
                    <i class="tabbar__icon 
                              ion-ios-hammer">
                    </i>
                </button>
            </label>
          
            <label class="tabbar__item">
                <input type="radio" 
                       name="tabs">
                <button class="tabbar__button">
                    <i class="tabbar__icon 
                              ion-ios-star">
                    </i>
                </button>
            </label>
  
            <label class="tabbar__item">
                <input type="radio" 
                       name="tabs">
                <button class="tabbar__button">
                    <i class="tabbar__icon 
                              ion-ios-calendar">
                    </i>
                </button>
            </label>
        </div>
    </center>
</body>
</html>


Output:

 

Reference: https://onsen.io/v2/api/css.html#tabbar-category


My Personal Notes arrow_drop_up
Like Article
Save Article
Related Articles

Start Your Coding Journey Now!