CheckboxField

A single checkbox for boolean values such as terms acceptance, opt-in flags, or any true/false toggle. The label is displayed inline next to the checkbox.

Basic Usage

<ArcadiaForm Model="model">
    <CheckboxField Field="@nameof(Model.AcceptTerms)" Label="I accept the terms and conditions" />
</ArcadiaForm>

Parameters

ParameterTypeDefaultDescription
ValueboolfalseWhether the checkbox is currently checked. Supports two-way binding.
ValueChangedEventCallback<bool>Callback invoked when the user toggles the checkbox.

Inherited from FieldBase

ParameterTypeDefaultDescription
Labelstring?nullVisible label displayed inline next to the checkbox.
HelperTextstring?nullHelper text displayed below the checkbox.
RequiredboolfalseWhether the checkbox must be checked.
DisabledboolfalseWhether the checkbox is disabled.
ErrorsIReadOnlyList<string>?nullValidation errors to display.
SchemaFieldSchema?nullField schema definition for dynamic form generation.

Validation

public class RegistrationModel
{
    [Range(typeof(bool), "true", "true", ErrorMessage = "You must accept the terms.")]
    public bool AcceptTerms { get; set; }
}

Accessibility

  • The label wraps the input, ensuring the entire label text is clickable.
  • Required fields set aria-required="true" and display a visual * indicator.
  • Validation errors are linked via aria-describedby and announced with role="alert".