Skip to content
Related Articles
Open in App
Not now

Related Articles

Onsen UI CSS Component Material Dialog

Improve Article
Save Article
  • Last Updated : 26 Jun, 2022
Improve Article
Save Article

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:

  • dialog-mask–material: This class is used to create the material dialog mask.
  • dialog–material: This class is used to create the material dialog box.
  • dialog-container–material: This class is used to create the material container.

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.

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

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


My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!