Check component
The Check
component is another basic element for user input. You can use this to supply a way for the user to toggle an option.
Check
Note: As of v0.9 it is required to define Check
value type by settings the TValue
attribute.
<Check TValue="bool">Check me out</Check>
Usage
With bind attribute
<Check TValue="bool" @bind-Checked="@rememberMe">Remember Me</Check>
@code{
bool rememberMe;
}
With event
<Check TValue="bool" Checked="@rememberMe" CheckedChanged="@OnRememberMeChanged">Remember Me</Check>
@code{
bool rememberMe;
void OnRememberMeChanged( bool value )
{
rememberMe = value;
}
}
Attributes
Name | Type | Default | Description |
---|---|---|---|
TValue | generic type | Data type of Checked value. Support types are bool and bool? . |
|
Checked | TValue |
default |
Gets or sets the checked flag. |
CheckedChanged | EventCallback<TValue> |
Occurs when the check state is changed. | |
Indeterminate | bool? |
null |
The indeterminate property can help you to achieve a ‘check all’ effect. |
Inline | bool |
false |
Group checkboxes on the same horizontal row. |
Cursor | Cursor | Default |
Defines the mouse cursor based on the behavior by the current CSS framework. |