ClassTelerikTextBox
The Telerik TextBox class.
Definition
Namespace:Telerik.Blazor.Components
Assembly:Telerik.Blazor.dll
Syntax:
public class TelerikTextBox : TextBoxBase, IComponent, IHandleEvent, IHandleAfterRender, IDisposable
Inheritance: objectComponentBaseBaseComponentTelerikInputBase<string>TextBoxBaseTelerikTextBox
Implements:
Inherited Members
Constructors
TelerikTextBox()
Declaration
public TelerikTextBox()
Properties
AutoComplete
Sets the HTML autocomplete attribute to control browser autofill behavior for form fields. Use "username" for login fields, "current-password" for existing passwords, "new-password" for password creation. Use "email", "tel", "name", "address-line1" and other standard values for appropriate browser assistance. Set to "off" to disable autocomplete for sensitive or unique fields. Improves user experience by enabling smart browser suggestions based on previous input. See MDN autocomplete documentation for complete list of values.
Declaration
[Parameter]
public string AutoComplete { get; set; }
Property Value
FillMode
Controls the visual fill style of the TextBox input field affecting its background and border appearance. "ThemeConstants.TextBox.FillMode.Solid" creates a filled background with high contrast borders for traditional form styling. "ThemeConstants.TextBox.FillMode.Outline" uses transparent background with prominent borders for modern, clean interfaces. "ThemeConstants.TextBox.FillMode.Flat" removes most borders and background for minimal, subtle integration. Choose based on your design language - "solid" for conventional forms, "outline" for contemporary UIs, "flat" for embedded contexts. Default value is "ThemeConstants.TextBox.FillMode.Solid".
Declaration
[Parameter]
public override string FillMode { get; set; }
Property Value
Overrides
MaxLength
Sets the maximum number of characters users can enter in the TextBox input field. Provides both client-side validation and helps users understand input constraints. Use for fields with database column limits, API constraints, or user experience requirements. Example: Set to 255 for typical database varchar fields, 50 for name fields, or 10 for phone numbers. When limit is reached, further typing is prevented and browsers may show character count feedback. Essential for preventing data truncation and providing clear user guidance.
Password
Enables password input mode to hide typed characters for security and privacy. When enabled, displays dots or asterisks instead of actual characters to prevent shoulder surfing. Automatically sets the HTML input type to "password" for proper browser behavior and accessibility. Essential for login forms, password creation/change fields, and any sensitive data entry. Does not affect the actual "TelerikInputBase{T}.Value" - only the visual representation. Default value is "false".
Rounded
Controls the corner rounding style of the TextBox input field for visual consistency with your design system. "ThemeConstants.TextBox.Rounded.Small" provides subtle rounded corners for a modern, soft appearance. "ThemeConstants.TextBox.Rounded.Medium" offers moderate rounding suitable for most business applications. "ThemeConstants.TextBox.Rounded.Large" creates prominent rounded corners for friendly, approachable interfaces. "ThemeConstants.TextBox.Rounded.Full" applies maximum rounding for pill-shaped inputs in contemporary designs. Should match other form elements and overall application design language for visual harmony. Default value is "ThemeConstants.TextBox.Rounded.Medium".
Declaration
[Parameter]
public override string Rounded { get; set; }
Property Value
Overrides
ShowClearButton
Controls whether a clear button (X icon) appears at the end of the TextBox input field. When enabled, users can click the clear button to instantly remove all text content. Improves user experience for quick content removal without selecting and deleting text manually. Most useful for search fields, filters, or temporary input areas where frequent clearing is expected. Default value is "false".
Declaration
[Parameter]
public bool ShowClearButton { get; set; }
Property Value
ShowPrefixSeparator
Controls whether a visual separator line appears between the prefix content and the input field. Creates a clear boundary when using TextBoxPrefixTemplate to prevent visual confusion. Set to "false" when prefix content should blend seamlessly with the input area. Helps maintain clean visual hierarchy especially with icon prefixes or when prefix content varies in size. Default value is "true".
Declaration
[Parameter]
public bool ShowPrefixSeparator { get; set; }
Property Value
ShowSuffixSeparator
Controls whether a visual separator line appears between the input field and the suffix content. Creates a clear boundary when using TextBoxSuffixTemplate to prevent visual confusion. Set to "false" when suffix content should blend seamlessly with the input area. Particularly useful when combining multiple suffix elements or when ShowClearButton is also enabled. Default value is "true".
Declaration
[Parameter]
public bool ShowSuffixSeparator { get; set; }
Property Value
Size
Controls the physical dimensions of the TextBox input field including height, padding, and font size. "ThemeConstants.TextBox.Size.Small" creates compact inputs suitable for dense layouts, data grids, or mobile interfaces. "ThemeConstants.TextBox.Size.Medium" provides standard sizing appropriate for most business forms and general use cases. "ThemeConstants.TextBox.Size.Large" offers prominent inputs ideal for primary actions, accessibility needs, or touch interfaces. Should be consistent across form elements and consider user accessibility requirements - larger sizes improve touch targets. Default value is "ThemeConstants.TextBox.Size.Medium".
Declaration
[Parameter]
public override string Size { get; set; }
Property Value
Overrides
TextBoxPrefixTemplate
Sets custom content to display before the input field as a visual prefix element. Use for icons, symbols, or short text that provides context about the expected input. Examples: currency symbols ("$"), search icons, user icons for login fields, or labels like "https://". Combines with ShowPrefixSeparator to control visual separation from the input area. Enhances usability by providing visual cues about input purpose or format expectations. Children: Use any HTML content or Blazor components as prefix content.
Declaration
[Parameter]
public RenderFragment TextBoxPrefixTemplate { get; set; }
Property Value
TextBoxSuffixTemplate
Sets custom content to display after the input field as a visual suffix element. Use for units of measurement, action buttons, or status indicators that relate to the input value. Examples: measurement units ("px", "kg", "%"), action icons (copy, paste), or validation status icons. Combines with ShowSuffixSeparator to control visual separation from the input area. Different from ShowClearButton which provides a specific clear functionality. Children: Use any HTML content or Blazor components as suffix content.
Declaration
[Parameter]
public RenderFragment TextBoxSuffixTemplate { get; set; }
Property Value
Methods
BuildRenderTree(RenderTreeBuilder)
Declaration
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
__builder
Overrides
OnInput(ChangeEventArgs)
Declaration
public void OnInput(ChangeEventArgs args)
Parameters
args