Onsen UI CSS Component Material List with Checkboxes
Last Updated :
03 Jul, 2022
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.
Lists are used to store data or information on web pages in ordered or unordered form. Onsen UI CSS Component Material List with Checkboxes is used to create the checkboxes in the material list using the below classes.
Onsen UI CSS Component Material List with Checkboxes Classes:
- checkbox--material: This class is used to create the material checkbox.
- checkbox--material__input: This class is used to create the material checkbox input.
- checkbox--material__checkmark: This class is used to create the material checkbox checkmark.
Syntax:
<ul class="list list--material">
<li class="list-item list-item--material">
<div class="list-item__left
list-item--material__left">
<label class="checkbox checkbox--material">
<input type="checkbox" id=".."
class="checkbox__input
checkbox--material__input">
<div class="checkbox__checkmark
checkbox--material__checkmark">
</div>
</label>
</div>
</ul>
Example 1: The following example demonstrates the Onsen UI CSS Component Material List with Checkboxes.
HTML
<!DOCTYPE html>
<html>
<head>
<!-- CDN links of Onsen UI library -->
<link rel="stylesheet" href=
"https://unpkg.com/onsenui/css/onsenui.css">
<link rel="stylesheet" href=
"https://unpkg.com/onsenui/css/onsen-css-components.min.css">
<script src=
"https://unpkg.com/onsenui/js/onsenui.min.js">
</script>
</head>
<body>
<center>
<h1 style="color: green;">
GeeksforGeeks
</h1>
<h3>
Onsen UI CSS Component
Material List with Checkboxes
</h3>
<ul class="list list--material">
<li class="list-item list-item--material">
<div class="list-item__left
list-item--material__left">
<label class="checkbox checkbox--material">
<input type="checkbox" id="cb"
class="checkbox__input
checkbox--material__input">
<div class="checkbox__checkmark
checkbox--material__checkmark">
</div>
</label>
</div>
<label for="cb" class="list-item__center
list-item--material__center">
<div class="list-item__title
list-item--material__title">
GeeksforGeeks
</div>
</label>
</li>
</ul>
</center>
</body>
</html>
Output:
Example 2: The following example demonstrates the Onsen UI CSS Component Material List with Checkboxes by specifying the disabled checkbox.
HTML
<!DOCTYPE html>
<html>
<head>
<!-- CDN links of Onsen UI library -->
<link rel="stylesheet" href=
"https://unpkg.com/onsenui/css/onsenui.css">
<link rel="stylesheet" href=
"https://unpkg.com/onsenui/css/onsen-css-components.min.css">
<script src=
"https://unpkg.com/onsenui/js/onsenui.min.js">
</script>
</head>
<body>
<center>
<h1 style="color: green;">
GeeksforGeeks
</h1>
<h3>
Onsen UI CSS Component
Material List with Checkboxes
</h3>
<ul class="list list--material">
<li class="list-item list-item--material">
<div class="list-item__left
list-item--material__left">
<label class="checkbox checkbox--material">
<input type="checkbox" id="cb"
class="checkbox__input
checkbox--material__input">
<div class="checkbox__checkmark
checkbox--material__checkmark">
</div>
</label>
</div>
<label for="cb" class="list-item__center
list-item--material__center">
<div class="list-item__title
list-item--material__title">
GeeksforGeeks
</div>
<div class="list-item__subtitle
list-item--material__subtitle">
This is subtitle 1
</div>
</label>
</li>
<li class="list-item list-item--material">
<div class="list-item__left
list-item--material__left">
<label class="checkbox checkbox--material">
<input type="checkbox" id="cb2"
class="checkbox__input
checkbox--material__input"
checked disabled>
<div class="checkbox__checkmark
checkbox--material__checkmark">
</div>
</label>
</div>
<label for="cb2" class="list-item__center
list-item--material__center">
<div class="list-item__title
list-item--material__title">
Disabled checkbox
</div>
<div class="list-item__subtitle
list-item--material__subtitle">
This is subtitle 2
</div>
</label>
</li>
</ul>
</center>
</body>
</html>
Output:
Reference: https://onsen.io/v2/api/css.html#list-category