Component

BOBInputCheckbox

Boolean input checkbox with label, helper text, and custom icons for checked/unchecked states. Optionally tri-state

API reference ↗

Basic usage

You must accept to continue.
RAZOR
<BOBInputCheckbox @bind-Value="_basic" Label="Accept terms" HelperText="You must accept to continue." />

Indeterminate

Nullability activates tri-state
RAZOR
<BOBInputCheckbox TValue="bool?" @bind-Value="_indeterminateValue" Label="Tristate Checkbox"
                  HelperText="Nullability activates tri-state" />

Sizes

RAZOR
<BOBInputCheckbox @bind-Value="_small" Size="BOBSize.Small" Label="Small" />
<BOBInputCheckbox @bind-Value="_medium" Size="BOBSize.Medium" Label="Medium" />
<BOBInputCheckbox @bind-Value="_large" Size="BOBSize.Large" Label="Large" />

Color

RAZOR
<BOBInputCheckbox @bind-Value="_primary" Color="@PaletteColor.Primary" Label="Primary" />
<BOBInputCheckbox @bind-Value="_success" Color="@PaletteColor.Success" Label="Success" />
<BOBInputCheckbox @bind-Value="_warning" Color="@PaletteColor.Warning" Label="Warning" />
<BOBInputCheckbox @bind-Value="_custom1" Color="#DDAAAA" Label="CustomHEX" />
<BOBInputCheckbox @bind-Value="_custom2" Color="rgb(25,45,65)" Label="CustomRGB" />

Density



RAZOR
<BOBInputCheckbox @bind-Value="_compactValue" Label="Compact" Density="BOBDensity.Compact" />
<br>
<BOBInputCheckbox @bind-Value="_standardValue" Label="Standard" Density="BOBDensity.Standard" />
<br>
<BOBInputCheckbox @bind-Value="_comfortableValue" Label="Comfortable" Density="BOBDensity.Comfortable" />

Custom Icons

RAZOR
<BOBInputCheckbox @bind-Value="_heart" CheckedIcon="@BOBIconKeys.MaterialIconsOutlined.i_favorite"
                  UncheckedIcon="@BOBIconKeys.MaterialIconsOutlined.i_favorite_border" Color="@PaletteColor.Error" Label="Favorite" />
<BOBInputCheckbox @bind-Value="_star" CheckedIcon="@BOBIconKeys.MaterialIconsOutlined.i_star"
                  UncheckedIcon="@BOBIconKeys.MaterialIconsOutlined.i_star_border" Color="@PaletteColor.Warning" Label="Starred" />

States

RAZOR
<BOBInputCheckbox @bind-Value="_required" Required="true" Label="Required" />
<BOBInputCheckbox @bind-Value="_readonly" ReadOnly="true" Label="ReadOnly" />
<BOBInputCheckbox @bind-Value="_disabled" Disabled="true" Label="Disabled" />

Properties

8 rows.
PropertyTypeDefaultDescription
SizeBOBSizeBOBSize.MediumVisual size of the component.
Colorstring?Text or foreground color. Accepts any valid CSS color value.
Labelstring?Floating label displayed above the component.
HelperTextstring?Helper text displayed below the component for additional context.
CheckedIconIconKey?Material icon name for the Checked.
UncheckedIconIconKey?Material icon name for the Unchecked.
IndeterminateIconIconKey?Material icon name for the Indeterminate.
DensityBOBDensityVertical density (gap) of the component.