Class MudCheckBox<T>
- Namespace
- MudBlazor
- Assembly
- MudBlazor.dll
Represents a form input for boolean values or selecting multiple items in a list.
public class MudCheckBox<T> : MudBooleanInput<T>, IComponent, IHandleEvent, IHandleAfterRender, IMudStateHasChanged, IFormComponent, IDisposable
Type Parameters
T
The type of item managed by this checkbox.
- Inheritance
-
MudFormComponent<T, bool?>MudCheckBox<T>
- Implements
- Inherited Members
- Extension Methods
Constructors
MudCheckBox()
public MudCheckBox()
Properties
CheckBoxClassname
protected string CheckBoxClassname { get; }
Property Value
CheckedIcon
The icon to display for a checked state.
[Parameter]
[Category("Appearance")]
public string CheckedIcon { get; set; }
Property Value
Remarks
Defaults to CheckBox.
ChildContent
The content within this checkbox.
[Parameter]
[Category("Behavior")]
public RenderFragment? ChildContent { get; set; }
Property Value
Classname
protected string Classname { get; }
Property Value
Color
The color of the checkbox.
[Parameter]
[Category("Appearance")]
public Color Color { get; set; }
Property Value
Remarks
Defaults to Default. Theme colors are supported.
Dense
Uses compact padding.
[Parameter]
[Category("Appearance")]
public bool Dense { get; set; }
Property Value
Remarks
Defaults to false
.
IndeterminateIcon
The icon to display for an indeterminate state.
[Parameter]
[Category("Appearance")]
public string IndeterminateIcon { get; set; }
Property Value
Remarks
Defaults to IndeterminateCheckBox.
KeyboardEnabled
Allows this checkbox to be controlled via the keyboard.
[Parameter]
[Category("Behavior")]
public bool KeyboardEnabled { get; set; }
Property Value
Remarks
Defaults to true
. The Space
key cycles through true and false values (or true/false/null states if TriState is true
). Delete
will clear the checkbox. Enter
(or NumPadEnter
) will set the checkbox. Backspace
will set an indeterminate value.
Label
The text to display next to the checkbox.
[Parameter]
[Category("Behavior")]
public string? Label { get; set; }
Property Value
Remarks
Defaults to null
.
LabelClassname
protected string LabelClassname { get; }
Property Value
LabelPosition
The position of the Label text.
[Parameter]
[Category("Behavior")]
public LabelPosition LabelPosition { get; set; }
Property Value
Remarks
Defaults to End.
Ripple
Shows a ripple effect when this checkbox is clicked.
[Parameter]
[Category("Appearance")]
public bool Ripple { get; set; }
Property Value
Remarks
Defaults to true
.
Size
The size of the checkbox.
[Parameter]
[Category("Appearance")]
public Size Size { get; set; }
Property Value
Remarks
Defaults to Medium.
TriState
Allows the checkbox to have an indeterminate state.
[Parameter]
[Category("Validation")]
public bool TriState { get; set; }
Property Value
Remarks
Defaults to false
. When true
, the checkbox can support an indeterminate state such as a null
value, in addition to true
and false
.
UncheckedColor
The color of the checkbox when its Value
is false
or null
.
[Parameter]
[Category("Appearance")]
public Color? UncheckedColor { get; set; }
Property Value
Remarks
Defaults to null
. Theme colors are supported.
UncheckedIcon
The icon to display for an unchecked state.
[Parameter]
[Category("Appearance")]
public string UncheckedIcon { get; set; }
Property Value
Remarks
Defaults to CheckBoxOutlineBlank.
Methods
BuildRenderTree(RenderTreeBuilder)
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
__builder
RenderTreeBuilder
Dispose(bool)
protected override void Dispose(bool disposing)
Parameters
disposing
bool
HandleKeyDown(KeyboardEventArgs)
protected void HandleKeyDown(KeyboardEventArgs obj)
Parameters
OnAfterRenderAsync(bool)
protected override Task OnAfterRenderAsync(bool firstRender)
Parameters
firstRender
bool
Returns
OnChange(ChangeEventArgs)
protected override Task OnChange(ChangeEventArgs args)
Parameters
args
ChangeEventArgs
Returns
OnInitialized()
protected override void OnInitialized()