Open In App

Onsen UI CSS Component Material Dialog

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.

A Dialog is a type of modal window which appears in front of app content to provide critical information or ask for a decision. Onsen UI CSS Component Material Dialog is used to create the dialog box in Onsen UI to provide important information to the user. To create the Material dialog, we will use the below classes.



Onsen UI CSS Component Material Dialog Classes:

Syntax:



<div class="dialog-mask dialog-mask--material"></div>
<div class="dialog dialog--material">
  <div class="dialog dialog-container--material">
    ....
  </div>
</div>

Example 1: The following example demonstrates the Onsen UI CSS Component Material Dialog.




<!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 Material Dialog
        </strong>
  
        <div class="dialog-mask dialog-mask--material"></div>
        <div class="dialog dialog--material">
            <div class="dialog dialog-container--material">
                <h2> GeeksforGeeks </h2>
                  
<p>
                    A Computer Science portal for geeks.
                </p>
  
            </div>
        </div>
    </center>
</body>
  
</html>

Output:

 

Example 2: The following example demonstrates the Onsen UI CSS Component Material Dialog.




<!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 Material Dialog
        </strong>
  
        <div class="dialog-mask dialog-mask--material"></div>
        <div class="dialog dialog--material">
            <div style="padding-left: 5px;" 
                 class="dialog dialog-container--material">
                  
<p> GeeksforGeeks </p>
  
                <button class="button button--material">
                    GFG 1
                </button>
                <button class="button button--material">
                    GFG 2
                </button>
            </div>
        </div>
    </center>
</body>
  
</html>

Output:

 

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


Article Tags :