HxInputCheckbox

Checkbox input.

Basic usage

Checked: False
<HxInputCheckbox @bind-Value="isChecked" Label="A simple checkbox" />

Checked: @isChecked

@code {
    bool isChecked;
}

Inline

Group checkboxes on the same horizontal row by adding Inline="true" to the checkboxes.

Button groups

HxInputCheckbox can be used within HxButtonGroup.

API

Parameters

Name Type Description
AdditionalAttributes IReadOnlyDictionary<string, TValue> A collection of additional attributes that will be applied to the created element.
ChipTemplate RenderFragment Chip template.
CssClass string Custom CSS class to render with wrapping div.
DisplayName string
Enabled bool? When null (default), the Enabled value is received from cascading FormState. When value is false, input is rendered as disabled. To set multiple controls as disabled use HxFormState.
GenerateChip bool When true, HxChipGenerator is used to generate chip item(s). Default is true.
Hint string Hint to render after input as form-text.
HintTemplate RenderFragment Hint to render after input as form-text.
Inline bool Allows grouping checkboxes on the same horizontal row by rendering them inline. Default is false.
InputCssClass string Custom CSS class to render with the input element.
Label string Label to render before input (or after input for Checkbox).
LabelCssClass string Custom CSS class to render with the label.
LabelTemplate RenderFragment Label to render before input (or after input for Checkbox).
ShowValidationMessage bool When false, validation message is not rendered. Default is true.
Value bool Value of the input. This should be used with two-way binding.
ValueChanged EventCallback<bool> A callback that updates the bound value.
ValueExpression Expression<Func<bool>> An expression that identifies the bound value.

Methods

Method Returns Description
FocusAsync() ValueTask Gives focus to the input element.
An unhandled error has occurred. Reload 🗙