Skip to content
Related Articles

Related Articles

Onsen UI CSS Component List Item with Icon

View Discussion
Improve Article
Save Article
  • Last Updated : 18 Jun, 2022
View Discussion
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.

Onsen UI CSS Component List Item with Icon is used to add the icon along with the list item using the list-item__icon class. 

Onsen UI CSS Component List Item with Icon Class:

  • list-item__icon: This class is used to add the icon to the list item.

Syntax:

<ul class="list">
    <li class="list-item">
        <div class="list-item__center">
            <div class="list-item__title">
                ...
            </div>
            <div class="list-item__right">
                <i class="... list-item__icon"></i>
            </div>
        </div>
    </li>
</ul>

Example 1: The following example demonstrates the Onsen UI CSS Component List Item with Icon.

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 List Item with Icon
        </strong>
          
        <ul class="list">
            <li class="list-item">
                <div class="list-item__center">
                    <div class="list-item__title">
                        GeeksforGeeks image
                    </div>
                </div>
  
                <div class="list-item__right">
                    <i class="ion-ios-menu list-item__icon"></i>
                </div>
            </li>
        </ul>
    </center>
</body>
  
</html>

Output:

 

Example 2: The following example demonstrates the Onsen UI CSS Component List Item with Icon.

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 List Item with Icon
        </strong>
          
        <ul class="list">
            <li class="list-item">
                <div class="list-item__center">
                    <div class="list-item__title">
                        GFG
                    </div>
                    <div class="list-item__subtitle">
                        This is subtitle
                    </div>
                </div>
  
                <div class="list-item__right">
                    <i class="ion-ios-calendar list-item__icon"></i>
                </div>
            </li>
  
            <li class="list-item">
                <div class="list-item__center">
                    <div class="list-item__title">
                        GeeksforGeeks
                    </div>
                </div>
  
                <div class="list-item__right">
                    <i class="ion-ios-hammer list-item__icon"></i>
                </div>
            </li>
        </ul>
    </center>
</body>
  
</html>

Output:

 

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


My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!