Skip to content
Related Articles

Related Articles

Onsen UI CSS Component Toolbar with Segment

View Discussion
Improve Article
Save Article
  • Last Updated : 28 Jun, 2022

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. In this article, we will see the Onsen UI CSS Component Toolbar with Segment.

The toolbar is a horizontal bar with some toolbar items and icons. Onsen UI CSS Component Toolbar with Segment is used to create the segment inside the toolbar with some segment items.

Onsen UI CSS Component Toolbar with Segment Classes:

  • segment: This class is used to create the segment.
  • segment__item: This class is used to create the segment item.
  • segment__input: This class is used to create the input.
  • segment__button: This class is used to create the segment button.

Syntax:

<div class="toolbar">
  <div class="toolbar__center">
    <div class="segment">
      <div class="segment__item">
        ...
      </div>
      ...
    </div>
  </div>
</div>

Example 1: The following example demonstrates the Onsen UI CSS Component Toolbar with Segment.

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>
        <h2 style="color: green;">
            GeeksforGeeks
        </h2>
        <strong>
            Onsen UI CSS Component Toolbar with Segment 
        </strong> <br> <br>
  
        <div class="toolbar">
            <div class="toolbar__center">
                <div class="segment" style="width:350px;">
                    <div class="segment__item">
                        <div class="segment__button">
                            Java
                        </div>
                    </div>
                    <div class="segment__item">
                        <div class="segment__button">
                            Python
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </center>
</body>
  
</html>


Output:

 

Example 2: The following example demonstrates the Onsen UI CSS Component Toolbar with Segment.

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>
        <h2 style="color: green;">
            GeeksforGeeks
        </h2>
        <strong>
            Onsen UI CSS Component Toolbar with Segment 
        </strong> <br> <br>
  
        <div class="toolbar">
            <div class="toolbar__center">
                <div class="segment" style="width:500px;">
                    <div class="segment__item">
                        <input type="radio" 
                               class="segment__input">
                        <div class="segment__button">
                            C
                        </div>
                    </div>
  
                    <div class="segment__item">
                        <input type="radio" 
                               class="segment__input">
                        <div class="segment__button">
                            C++
                        </div>
                    </div>
  
                    <div class="segment__item">
                        <input type="radio" 
                               class="segment__input">
                        <div class="segment__button">
                            Java
                        </div>
                    </div>
  
                    <div class="segment__item">
                        <input type="radio" 
                               class="segment__input">
                        <div class="segment__button">
                            Python
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </center>
</body>
  
</html>


Output:

 

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


My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!