Open In App

Onsen UI CSS Component Segment Button Bar

Improve
Improve
Like Article
Like
Save
Share
Report

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:

  • button-bar: This class is used to create the button bar.
  • button-bar__item: This class is used to create the button bar items.
  • button-bar__button: This class is used to create the button.

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.

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 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.

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 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



Last Updated : 22 Jun, 2022
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads