New to Telerik UI for BlazorStart a free 30-day trial

The base class for textbox components.

Definition

Namespace:Telerik.Blazor.Components.Common

Assembly:Telerik.Blazor.dll

Syntax:

C#
public abstract class TextBoxBase : TelerikInputBase<string>, IComponent, IHandleEvent, IHandleAfterRender, IDisposable

Inheritance: objectComponentBaseBaseComponentTelerikInputBase<string>TextBoxBase

Derived Classes: TelerikMaskedTextBoxTelerikPromptBoxTelerikTextAreaTelerikTextBox

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.InvokeVoidAsyncWithoutAwait(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

C#
protected TextBoxBase()

Properties

[Accessibility] 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.

C#
[Parameter]
public string AutoCapitalize { get; set; }

Gets or sets the description used for the data-smart-paste attribute.

C#
[Parameter]
public string DataSmartPasteDescriptionAttribute { get; set; }

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.

C#
[Parameter]
public int DebounceDelay { get; set; }
C#
public abstract string FillMode { get; set; }

[Accessibility] 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.

C#
[Parameter]
public string Name { get; set; }

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.

C#
[Parameter]
public string Placeholder { get; set; }

[Accessibility] 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".

C#
[Parameter]
public bool ReadOnly { get; set; }
C#
public abstract string Rounded { get; set; }
C#
public abstract string Size { get; set; }

[Accessibility] 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.

C#
[Parameter]
public string SpellCheck { get; set; }

[Accessibility] 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.

C#
[Parameter]
public string Title { get; set; }

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.

C#
[Parameter]
public string Width { get; set; }

Methods

C#
public override void Dispose()

Overrides: TelerikInputBase<string>.Dispose()

C#
protected Task InitJsComponentAsync()
Returns:

Task

C#
protected override Task OnAfterRenderAsync(bool firstRender)
Parameters:firstRenderboolReturns:

Task

Overrides: BaseComponent.OnAfterRenderAsync(bool)

C#
protected virtual Task OnAfterRenderInternalAsync(bool firstRender)
Parameters:firstRenderboolReturns:

Task

C#
protected override Task OnParametersSetAsync()
Returns:

Task

Overrides: TelerikInputBase<string>.OnParametersSetAsync()

C#
protected virtual Task OnParametersSetInternalAsync()
Returns:

Task

C#
protected void UpdateValueDebounced(string newValue)
Parameters:newValuestring