Blazor Checkbox Overview
The Blazor Checkbox component allows you to add more customizable checkboxes to your application. It maintains the behavior of the standard HTML checkbox and provides checked, unchecked and indeterminate states.
Creating Blazor Checkbox
-
Add the
TelerikCheckBoxtag to a Razor file. -
Set the
Valueparameter to aboolobject. It supports one-way and two-way binding. -
(optional) Set the
Idparameter to attach a<label>to the checkbox.
Basic setup of the Telerik CheckBox using two-way data binding.
Indeterminate State
In addition to basic checked and unchecked states, the Blazor CheckBox has a third state - indeterminate. Read more about the Blazor Checkbox indeterminate state.
Appearance
The Checkbox component provides size and border settings to control its appearance. Read more about the Blazor Checkbox appearance settings.
To learn more about the appearance, anatomy, and accessibility of the CheckBox, visit the Progress Design System Kit documentation—an information portal offering rich component usage guidelines, descriptions of the available style variables, and globalization support details.
Events
The Blazor Checkbox fires value change, focus and state change events that you can handle and further customize its behavior. Read more about the Blazor Checkbox events.
Checkbox Parameters
The Blazor CheckBox provides various parameters that allow you to configure the component:
| Parameter | Type | Description |
|---|---|---|
Class | string | Renders a custom CSS class to the <input class="k-checkbox"> element. |
Enabled | bool | Whether the component is enabled. |
Id | string | Renders as the id attribute on the <input /> element, so you can attach a <label for=""> to it. |
Indeterminate | bool | Puts the CheckBox in its third state - Indeterminate. See the Indeterminate state article for more information and examples. |
TabIndex | Nullable<int> | The tabindex attribute rendered on the CheckBox. |
Value | bool | Mapped to the Checked property of the normal HTML checkbox. |
See also the Input Validation article.
Common Example
Example that showcases the "I agree to the terms and conditions" basic scenario.