Open In App

Onsen UI Text Input 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 will learn about how to include text input using Onsen UI.

Text Input provides an input field of text type where the user can provide text.



Onsen UI Text Input CSS Components Classes:

Syntax:



<div class="Text Input Components Class">
     ...
</div>

Example 1: In this example, we will make use of the above classes to demonstrate the use of text input.




<!DOCTYPE html>
<html>
  
<head>
    <!-- CDN links of Onsen UI library -->
    <link rel="stylesheet" href=
    <link rel="stylesheet" href=
    <script src=
    </script>
</head>
  
<body>
    <center>
        <h1 style="color:green;">
            GeeksforGeeks
        </h1>
       <h2>
             Onsen UI Text Input CSS Components
       </h2>
        <div>
            <input type="text" 
                   class="text-input" 
                   placeholder="text" 
                   value="">
        </div>
    </center>
</body>
</html>

Output:

 

Example 2: In this example, we will make use of the above classes to demonstrate the use of text input.




<!DOCTYPE html>
<html>
  
<head>
    <!-- CDN links of Onsen UI library -->
    <link rel="stylesheet" href=
    <link rel="stylesheet" href=
    <script src=
    </script>
</head>
  
<body>
    <center>
        <h1 style="color:green;">
            GeeksforGeeks
        </h1>
        <h3>
              Onsen UI Text Input CSS Components
         </h3>
        <div>
            <input type="text" 
                   class="text-input text-input--underbar" 
                   placeholder="text" 
                   value="">
        </div>
     </center>
</body>
</html>

Output:

 

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


Article Tags :