Open In App

Onsen UI Toolbar Button CSS Components

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 are going to implement the Onsen UI Toolbar button CSS Component.

 The Toolbar Button Component is used to display a toolbar button inside the toolbar. There are two types of toolbar buttons, namely a simple toolbar button and a material toolbar button.



Onsen UI Toolbar Button CSS Component Classes:

Syntax:



<button class="toolbar-button">
  <i class="..."></i>
</button>

Example 1: The following example demonstrates the use of the toolbar-button class of the Onsen UI toolbar button CSS component. The icons are inserted using the HTML <i> tag and the font-awesome library.




<!DOCTYPE html>
<html lang="en">
 
<head>
    <meta charset="UTF-8" />
    <meta name="viewport"
          content="width=device-width,
                   initial-scale=1.0" />
    <title>GeeksforGeeks | Onsen UI CSS</title>
    <link rel="stylesheet" href=
    <link rel="stylesheet" href=
    <link rel="stylesheet" href=
</head>
 
<body>
    <center>
        <h2 style="color:green">GeeksforGeeks</h2>
        <strong>Onsen UI Toolbar button CSS Component</strong>
        <br/>
        <button class="toolbar-button">
            <i class="fa fa-bell" style="font-size:17px"></i>
                New Notification
        </button>
    </center>
</body>
</html>

Output:

 

Example 2: The following example demonstrates the use of toolbar-button–material class of the Onsen UI toolbar button CSS component. The buttons can be created using HTML <span> tag as shown below.




<!DOCTYPE html>
<html lang="en">
 
<head>
    <meta charset="UTF-8" />
    <meta name="viewport"
          content="width=device-width,
                   initial-scale=1.0" />
    <title>GeeksforGeeks | Onsen UI CSS</title>
    <link rel="stylesheet" href=
    <link rel="stylesheet" href=
    <link rel="stylesheet" href=
</head>
 
<body>
    <center>
        <h2 style="color:green">GeeksforGeeks</h2>
            <strong>
                Onsen UI Material Toolbar button CSS Component
            </strong>
        <br/>
        <br>
        <span class="toolbar-button toolbar-button--material">
            <i class="zmdi zmdi-menu"></i>
            Menu details
        </span>
        <span class="toolbar-button toolbar-button--material">
          <i class="zmdi zmdi-favorite"></i>
          Favourite cuisine
        </span>
    </center>
</body>
</html>

Output:

 

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


Article Tags :