TextField

A single-line text input field that supports two-way binding and integrates with the Arcadia FormBuilder validation system. The InputType parameter allows you to leverage browser-native input behaviors for email, URL, telephone, and other text-like types.

Basic Usage

<ArcadiaForm Model="model">
    <TextField Field="@nameof(Model.FullName)" Label="Full Name" />
</ArcadiaForm>

Email Input

<TextField Field="@nameof(Model.Email)" Label="Email Address" InputType="email" Placeholder="you@example.com" />

Parameters

ParameterTypeDefaultDescription
Valuestring?nullThe current text entered by the user. Supports two-way binding.
ValueChangedEventCallback<string?>Callback invoked whenever the user modifies the text.
InputTypestring"text"The HTML input type attribute. Change to "email", "url", "tel", etc. for browser-native behaviors.

Inherited from FieldBase

ParameterTypeDefaultDescription
Labelstring?nullVisible label displayed above the field.
Placeholderstring?nullPlaceholder text shown when the field is empty.
HelperTextstring?nullHelper text displayed below the field.
RequiredboolfalseWhether the field is required.
DisabledboolfalseWhether the field is disabled.
ReadOnlyboolfalseWhether the field is read-only.
ErrorsIReadOnlyList<string>?nullValidation errors to display.
SchemaFieldSchema?nullField schema definition for dynamic form generation.

Validation

<ArcadiaForm Model="model">
    <TextField Field="@nameof(Model.Username)"
               Label="Username"
               Required="true"
               HelperText="Must be between 3 and 50 characters." />
</ArcadiaForm>
public class UserModel
{
    [Required]
    [StringLength(50, MinimumLength = 3)]
    public string Username { get; set; } = "";
}

Accessibility

  • Label is linked to the input via for/id attributes.
  • Required fields set aria-required="true" and display a visual * indicator.
  • Validation errors are linked via aria-describedby and announced with role="alert".
  • Helper text is linked via aria-describedby.