The TextBox component allows you to display, enter and edit plain text in Blazor forms. You can completely customize the TextBox component using its built-in features: CSS Class for styling, Enabled (controls whether the input is enabled/disabled), Width, Value (getting and setting of value), Label (rendered text with additional information about the TextBox) and built-in validation within EditFrom. The TextBox component works in both WebAssembly (WASM) and Server-side Blazor apps.
Example of Blazor TextBox Component with Floating Label.
The Telerik UI for Blazor suite supports and integrates seamlessly into Blazor's Forms and Validation infrastructure. All Telerik UI for Blazor Input components (including simple inputs such as TextBox, Numeric TextBox and DateInput) work out of the box when placed inside an EditForm, respond to EditContext changes and provide default invalid styles. You can choose whether validation is triggered on change, blur or while typing – whatever the best option is for each scenario.
When you need to validate user input, the Telerik TextBox for Blazor is the perfect match.
Example of user input validation with Blazor TextBox component.
The TextBox exposes OnChange and ValueChanged events to let you handle user input and perform the necessary flow of logic in your code. The component also fires the OnBlur event which is triggered when it loses focus. You have full control the user actions with the TextBox component – from capturing user keystrokes to confirmation of the changed TextBox values.
There are several more minor parameters of a Telerik UI for Blazor TextBox component which control a variety of functionalities:
The TextBox can also be used to input passwords in login and registration forms. Switching between a plain-text TextBox and one used for entering passwords is as easy as enabling the Password attribute on the element.
The TextBox has validation modes that allow you to define whether to trigger validation on change, blur or while typing, allowing you to choose the best one for a specific use case.
The Telerik Blazor TextBox has several built-in themes such as Default (our own styling), Material (based on the Material Design guidelines), Bootstrap (which looks like the Bootstrap styling to integrate better) and Fluent (based on Microsoft Fluent UI). You can easily customize any of out-of-the-box themes with a few lines of CSS, or create new theme to match your colors and branding by using the the Telerik Saas ThemeBuilder application.
The Telerik UI for Blazor TextBox component supports right-to-left configuration. The RTL functionality is supported by most of our components to accommodate users who communicate in a right-to-left language script, such as Arabic and Hebrew.
Learn more in our Blazor Right-to-Left Support documentation