InputKit: CheckBox
A checkbox control that is useful, customizable, full-featured, fully-bindable and easy to use.
Dark - Desktop | Light - Mobile |
---|---|
![]() |
![]() |
You can visit entire code of this sample from here
Supported Platforms
- | MAUI | Xamarin Forms |
---|---|---|
Windows | ✅ | v4.0+ |
macOS | ✅ | ✅ |
Linux | ❌ | ❌ |
Android | ✅ | ✅ |
iOS | ✅ | ✅ |
Usage
Before starting to use. Make sure you're not using MAUI/Xamarin Forms checkbox in your pages.
Make sure you defined InputKit namespace in your XAML file.
MAUI | xmlns:input="clr-namespace:InputKit.Shared.Controls;assembly=InputKit.Maui" |
Xamarin Forms | xmlns:input="clr-namespace:Plugin.InputKit.Shared.Controls;assembly=Plugin.InputKit" |
Now you're ready to use it in your XAML page.
Data Binding
All of the properties of the CheckBox control can be bound to any property of any object that supports data binding.
- You can bind the
IsChecked
property to any property of ViewModel to handle the checkbox state.
- You can bind the
CheckChangedCommand
property to any command of ViewModel to handle the checkbox changes. This command is executed right after the checkbox is checked or unchecked.
If you're looking for dynamic CheckBox list and want to get only selected item/items after selection. Check the SelectionView
- Rest of the visual properties are bindable as well.
Customization
CheckBox allows you to customize its appearance in different ways.
Type
CheckBox supports three types of appearance:
- Regular - default type, looks like a checkbox.
- Filled - looks like filled when selected with Border Color of the control.
- Material - looks like filled when selected with Color
property color.
Regular Type
This is default value. If you don't specify any type, it will be regular type.
Filled Type
This type is used when you want to fill the control with Border Color of the control when it's selected.
Material Type
This type is used when you want to fill the control with Color
property color when it's selected.
Icons
CheckBox icon can be customized in two different ways. You can use predefined shapes or you can use custom shape. InputKit provides a collection of predefined shapes that can be used as an icon.
Check all Predefined Shapes for more info.
- Predefined shapes can be used as parameter of
IconGeometry
property.
- Custom shape can be used as parameter of
IconGeometry
property. A plain SVG path can be used as an icon.
Label Position
CheckBox supports two label positions: - Before - label is positioned before the control. - After - label is positioned after the control. (default)
Colors
You can customize CheckBox colors by setting Color
, BackgroundColor
, BorderColor
, BoxBackgroundColor
, TextColor
and IconColor
properties.
Color property will be applied when you set Type
to Material
.
Behaviors
** Work in progess... **:
- Actions to override
- VisualStates
- Make your own animation (?)