A checkbox is a type of input components which holds the Boolean value. It is similar to HTML checkbox inputs. The Ionic checkboxes are styled differently on each platform as like other Ionic components. You can use checked attribute with the <ion-checkbox> element to set the default value, and disabled attribute to disable the user from changing the value.
The following example shows different types of checkboxes used in an Ionic application.
When you execute the app in your terminal, it will give the following output.
If you want to style your checkbox, use Ionic color attribute with the checkbox prefix. The following example explains the use of the Ionic color property with the checkbox component.
Checkboxes in a List
You can also use checkbox with the list. The following example explains how checkbox can be used with the list.