Onsen UI Checkbox 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.
Checkboxes are used for instances where a user may wish to select multiple options, such as in the instance of a “check all that apply” question, in forms. In this article, we will discuss Onsen UI Checkbox CSS Components.
Onsen UI Checkbox CSS Components:
- Checkbox: It is used to create the basic checkbox.
- No border Checkbox: It is used to create the checkbox without the border.
- Material Checkbox: It is used to create the material checkbox.
Syntax:
<label class="checkbox ...">
<input type="checkbox" class="checkbox__input">
<div class="checkbox__checkmark"></div>
...
</label>
Example 1: The following example demonstrates the basic checkbox.
HTML
<!DOCTYPE html>
< html >
< head >
< 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 Basic Checkbox
</ strong > < br > < br >
< label class = "checkbox" >
< input type = "checkbox" class = "checkbox__input" >
< div class = "checkbox__checkmark" ></ div >
GeeksforGeeks
</ label >
</ center >
</ body >
</ html >
|
Output:
Example 2: The following example demonstrates the Onsen UI CSS Component No border Checkbox.
HTML
<!DOCTYPE html>
< html >
< head >
< 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 No border Checkbox
</ strong > < br > < br >
< label class = "checkbox checkbox--noborder" >
< input type = "checkbox"
class="checkbox__input
checkbox--noborder__input">
< div class="checkbox__checkmark
checkbox--noborder__checkmark">
</ div >
Checkbox
</ label >
</ center >
</ body >
</ html >
|
Output:
Example 3: The following example demonstrates the Onsen UI CSS Component Material Checkbox.
HTML
<!DOCTYPE html>
< html >
< head >
< 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 Checkbox
</ strong > < br > < br >
< label class = "checkbox checkbox--material" >
< input type = "checkbox"
class="checkbox__input
checkbox--material__input">
< div class="checkbox__checkmark
checkbox--material__checkmark">
</ div >
GeeksforGeeks
</ label >
</ center >
</ body >
</ html >
|
Output:
Reference: https://onsen.io/v2/api/css.html#checkbox-category
Last Updated :
02 Sep, 2022
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...