Class
TextBoxBase

The base class for textbox components.

Definition

Namespace:Telerik.Blazor.Components.Common

Assembly:Telerik.Blazor.dll

Syntax:

cs-api-definition
public abstract class TextBoxBase : TelerikInputBase<string>, IComponent, IHandleEvent, IHandleAfterRender, IDisposable

Inheritance: objectComponentBaseBaseComponentTelerikInputBase<string>TextBoxBase

Derived Classes: TelerikMaskedTextBoxTelerikTextAreaTelerikTextBox

Implements: IComponentIDisposableIHandleAfterRenderIHandleEvent

Inherited Members TelerikInputBase<string>.SetParametersAsync(ParameterView)TelerikInputBase<string>.OnInitializedAsync()TelerikInputBase<string>.FocusAsync()TelerikInputBase<string>.CascadedEditContextTelerikInputBase<string>.FloatingLabelTelerikInputBase<string>.IdTelerikInputBase<string>.EnabledTelerikInputBase<string>.TabIndexTelerikInputBase<string>.ValueExpressionTelerikInputBase<string>.ValueChangedTelerikInputBase<string>.ValueTelerikInputBase<string>.OnChangeTelerikInputBase<string>.OnBlurTelerikInputBase<string>.AriaLabelTelerikInputBase<string>.AriaLabelledByTelerikInputBase<string>.AriaDescribedByTelerikInputBase<string>.ValidateOnTelerikInputBase<string>.InputModeBaseComponent.ShouldRender()BaseComponent.InitLocalizer()BaseComponent.ThrowIfParameterIsNull(object, string)BaseComponent.HaveOptionsChanged(IDictionary<string, object>, IDictionary<string, object>)BaseComponent.GetClassString(params string[])BaseComponent.InvokeAsync<T>(string, params object[])BaseComponent.InvokeAsync<T>(string, CancellationToken, params object[])BaseComponent.InvokeVoidAsync(string, params object[])BaseComponent.InvokeComponentMethodAsync<T>(string, params object[])BaseComponent.InvokeComponentMethodAsync<T>(string, CancellationToken, params object[])BaseComponent.InvokeVoidComponentMethodAsync(string, params object[])BaseComponent.InvokeComponentVoidMethodAsync(string, object)BaseComponent.InvokeDisposeAsync()BaseComponent.StateHasChanged()BaseComponent.RootComponentBaseComponent.ClassComponentBase.BuildRenderTree(RenderTreeBuilder)ComponentBase.OnInitialized()ComponentBase.OnParametersSet()ComponentBase.OnAfterRender(bool)ComponentBase.InvokeAsync(Action)ComponentBase.InvokeAsync(Func<Task>)ComponentBase.DispatchExceptionAsync(Exception)

Constructors

TextBoxBase()

Declaration

cs-api-definition
protected TextBoxBase()

Properties

AutoCapitalize

Sets the HTML autocapitalize attribute to control automatic capitalization behavior for mobile devices and browsers. Use "off" to disable capitalization, "words" to capitalize first letter of each word, "sentences" for sentence capitalization. Particularly useful for mobile web applications where virtual keyboards can provide automatic capitalization assistance. Examples: "words" for name fields, "sentences" for comment areas, "off" for email/username fields or technical content. Helps improve mobile user experience by reducing manual capitalization effort and ensuring consistent text formatting. Support and behavior varies by browser and mobile platform - test with target devices for optimal results.

Declaration

cs-api-definition
[Parameter]
public string AutoCapitalize { get; set; }

Property Value

string

DebounceDelay

Sets the delay in milliseconds between user's last keystroke and when the value is updated and events are triggered. Prevents excessive processing during rapid typing while maintaining responsive user experience for real-time features. Use lower values (50-100ms) for immediate validation feedback, higher values (200-500ms) for expensive operations like API calls. Balances performance with responsiveness - longer delays reduce server load but may feel less responsive. Essential for scenarios with search-as-you-type, real-time validation, or dependent field updates that should not fire continuously. Default value is 150ms, providing optimal balance for most text input scenarios.

Declaration

cs-api-definition
[Parameter]
public int DebounceDelay { get; set; }

Property Value

int

FillMode

Declaration

cs-api-definition
public abstract string FillMode { get; set; }

Property Value

string

Name

Sets the HTML name attribute for form identification and data submission in traditional HTML forms. Required for proper form data collection when submitting to server endpoints or for form processing libraries. Use descriptive names that match your data model properties like "firstName", "email", or "phoneNumber". Essential for server-side form processing, automated form testing, and accessibility tools that rely on form structure. Should be unique within the form and follow consistent naming conventions across your application. Examples: "username" for login fields, "billingAddress" for address fields, "customerEmail" for contact forms.

Declaration

cs-api-definition
[Parameter]
public string Name { get; set; }

Property Value

string

Placeholder

Sets placeholder text that appears in the input field when no value is entered to guide user input. Provides inline hints about expected content format, purpose, or examples without taking additional screen space. Use descriptive text like "Enter your email address", "Search...", or "First Name" to clarify field purpose. Should be concise, action-oriented, and complement any Title or label text. Examples: "john@example.com" for email fields, "Type to search..." for search boxes, "Optional comment" for optional fields. Essential for improving form completion rates and reducing user confusion about field requirements.

Declaration

cs-api-definition
[Parameter]
public string Placeholder { get; set; }

Property Value

string

ReadOnly

Controls whether the input field can be modified by user typing while still allowing programmatic value changes. When enabled, prevents keyboard input but maintains visual state and allows external updates to the value. Useful for display-only fields, calculated values, or when input should only come from specific sources like button clicks. Users can still focus the field for accessibility but cannot modify content through typing. Different from "TelerikInputBase{T}.Enabled" which disables all interactions including focus and selection. Default value is "false".

Declaration

cs-api-definition
[Parameter]
public bool ReadOnly { get; set; }

Property Value

bool

Rounded

Declaration

cs-api-definition
public abstract string Rounded { get; set; }

Property Value

string

Size

Declaration

cs-api-definition
public abstract string Size { get; set; }

Property Value

string

SpellCheck

Sets the HTML spellcheck attribute to control browser spell-checking behavior for the input field. Use "true" to enable spell checking for user-generated content, "false" to disable for technical or formatted content. Particularly valuable for text areas, comment fields, and content creation where spelling accuracy is important. Examples: "true" for message composition, "false" for code input, email addresses, or proper names. Improves user experience by providing automatic spelling assistance while avoiding false positives on technical content. Support and behavior depends on user environment, browser settings, and available spell-check dictionaries.

Declaration

cs-api-definition
[Parameter]
public string SpellCheck { get; set; }

Property Value

string

Title

Sets the HTML title attribute to provide additional context or help text when users hover over the component. Use for brief explanations, format requirements, or helpful hints that enhance user understanding. Examples: "Enter your full name as it appears on official documents", "Format: MM/DD/YYYY", or "Required field". Improves accessibility and provides contextual guidance without cluttering the interface. Should complement Placeholder but provide more detailed information when needed. Essential for complex fields or when additional context improves user success rates.

Declaration

cs-api-definition
[Parameter]
public string Title { get; set; }

Property Value

string

Width

Sets the width of the text input component using CSS length units for responsive design control. Controls the horizontal space the component occupies within your layout and form structure. Use specific units like "300px" for fixed width, "50%" for responsive design, or "100%" to fill parent container. Consider content length, prefix/suffix elements, and mobile responsiveness when setting width values. Examples: "250px" for name fields, "400px" for email addresses, "100%" for comments, "80px" for short codes. Should accommodate expected content length while maintaining good visual proportion within the form layout.

Declaration

cs-api-definition
[Parameter]
public string Width { get; set; }

Property Value

string

Methods

Dispose()

Declaration

cs-api-definition
public override void Dispose()

Overrides TelerikInputBase<string>.Dispose()

InitJsComponentAsync()

Declaration

cs-api-definition
protected Task InitJsComponentAsync()

Returns

Task

OnAfterRenderAsync(bool)

Declaration

cs-api-definition
protected override Task OnAfterRenderAsync(bool firstRender)

Parameters

firstRender

bool

Returns

Task

Overrides BaseComponent.OnAfterRenderAsync(bool)

OnAfterRenderInternalAsync(bool)

Declaration

cs-api-definition
protected virtual Task OnAfterRenderInternalAsync(bool firstRender)

Parameters

firstRender

bool

Returns

Task

OnParametersSetAsync()

Declaration

cs-api-definition
protected override Task OnParametersSetAsync()

Returns

Task

Overrides TelerikInputBase<string>.OnParametersSetAsync()

OnParametersSetInternalAsync()

Declaration

cs-api-definition
protected virtual Task OnParametersSetInternalAsync()

Returns

Task