Open In App

Onsen UI CSS Component Segment Button Bar

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.

The segment is used to create a group of related content. Onsen UI CSS Component Segment Button Bar is used to create the segment with some buttons. We can create the Segment Button Bar using these below classes.



Onsen UI CSS Component Segment Button Bar Classes:

Syntax:



<div class="button-bar" style="width:100px;">
  <div class="button-bar__item">
    <button class="button-bar__button">
        ...
    </button>
  </div>
  ...
</div>

Example 1: The following example demonstrates the Onsen UI CSS Component Segment Button Bar.




<!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 Segment Button Bar
        </strong> <br> <br>
  
        <div class="button-bar" style="width:120px;">
            <div class="button-bar__item">
                <button class="button-bar__button">
                    GFG 1
                </button>
            </div>
            <div class="button-bar__item">
                <button class="button-bar__button">
                    GFG 2
                </button>
            </div>
        </div>
    </center>
</body>
  
</html>

Output:

 

Example 2: The following example demonstrates the Onsen UI CSS Component Segment Button Bar.




<!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 Segment Button Bar
        </strong> <br> <br>
  
        <div class="button-bar" style="width: 400px;">
            <div class="button-bar__item">
                <button class="button-bar__button">
                   Btn 1
                </button>
            </div>
            <div class="button-bar__item">
                <button class="button-bar__button">
                    Btn 2
                </button>
            </div>
            <div class="button-bar__item">
                <button class="button-bar__button">
                    Btn 3
                </button>
            </div>
        </div> <br> <br>
  
        <div class="button-bar" style="width: 400px;">
            <div class="button-bar__item">
                <button class="button-bar__button">
                   GFG 1
                </button>
            </div>
            <div class="button-bar__item">
                <button class="button-bar__button">
                    GFG 2
                </button>
            </div>
            <div class="button-bar__item">
                <button class="button-bar__button">
                    GFG 3
                </button>
            </div>
            <div class="button-bar__item">
                <button class="button-bar__button">
                    GFG 4
                </button>
            </div>
            <div class="button-bar__item">
                <button class="button-bar__button">
                    GFG 5
                </button>
            </div>
        </div>
    </center>
</body>
  
</html>

Output:

 

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


Article Tags :