These editor-like components can help you improve the user experience of your Blazor application, with settings and customizations that adapt to the scenario you need.
If you have developed projects in Blazor, you’ve likely had to create some kind of form using Blazor controls.
Although the platform provides native components such as InputText, InputNumber or InputDate, during development we realize we need specialized components to allow displaying interactive calendars, color pickers or rating controls.
In these cases, the prebuilt controls from the Progress Telerik UI for Blazor library can help us significantly by providing advanced editor components that drastically improve the user experience, without you having to write additional code. Let’s take a closer look at how they can help!
Comparing Native Components vs. Telerik Editors
Blazor offers a number of basic input components, such as:
- InputText for text fields
- InputNumber for basic numeric fields
- InputDate for date selection
- InputSelect for dropdown lists
- InputCheckbox for checkboxes
- InputTextArea for multi-line text areas
Although the above components serve their purpose for basic scenarios, they lack features that are necessary when building serious, functional applications, such as applying custom visual formatting, input masks, autocomplete, among others.
On the other hand, the category of Editors in Telerik UI for Blazor includes more than 20 specialized components that are not available natively for Blazor, including:
- TelerikColorPicker: Color picker with palette and HSV gradient
- TelerikRating: Component for entering a configurable star rating
- TelerikSignature: Allows capturing digital signatures in base64 format
- TelerikAutoComplete: Search with suggestions as the user types
- TelerikMaskedTextBox: Text boxes with masks for phone numbers, cards, etc.
- TelerikDateRangePicker: Date range selection
The above components provide a way to build forms and applications more quickly, since otherwise you would have to build them from scratch or resort to external JavaScript libraries that require interop that can be somewhat complex.
There are some additional reasons why it’s convenient to use Telerik components. First, all editors integrate seamlessly with Blazor’s form validation system.
Additionally, Telerik components adhere to accessibility standards without you having to configure anything else. They also have full support for different cultures, date formats, currencies and RTL direction.
Creating a Form Using Telerik for Blazor UI Editors
Let’s look at the benefits of the Telerik editors by creating a user profile form to see their capabilities.
Creating a Project with Telerik Editors for Blazor
Let’s start by creating a Blazor project using the Blazor Web App template. We’ll select an Interactive render mode of Server and Interactivity location of Global.
To install the Telerik components, you can use the prebuilt Telerik template and follow the quick-start guide, or, if you want to add the components to an existing project, you can also do so by following this guide.
Now let’s move on to creating a data model to bind to the UI components.
Creating a Data Model
We’ll create a data model that allows us to build a logical representation of a user’s profile. For this, we’ll create a class called UserProfile that will look like the following:
The model above reflects properties characteristic of a user profile, such as FullName, BirthDate and Age. Additionally, we added some extra properties to represent favorite color, satisfaction rating and signature.
Building a Form Page Using Prebuilt Blazor Controls
Let’s create a page so a user can enter their user profile data. We’ll do this in parts so you can see the power of the Blazor components.
First, let’s create a component called UserProfileForm.razor, where we’ll start by defining the overall structure of the component, such as the route from which it will be accessed, the title, among other things:
Now, let’s analyze the integration of the Telerik components into the form.
Using TelerikTextBox as Text Inputs
The first component we will add is a TelerikTextBox, which will be used to get the user’s name. Although at first glance it may seem similar to a native InputText, it has additional features such as a built-in visual placeholder and prebuilt applicable styles that are consistent throughout the application.
This is how the section looks:
The result of the execution is the following:
In the code above, we can see how using properties such as @bind-value, Placeholder and Width facilitates creating intuitive UIs without having to add extra code.
Selecting Dates with the TelerikDatePicker
The next component we will analyze is the TelerikDatePicker. Blazor offers a native control called InputDate; however, it does not provide the best user experience.
The Telerik component offers a full visual calendar with month and year navigation, customizable formatting, the ability to disable specific dates, programmatic focus, the ability to specify an initial view, among many other features.
Its implementation looks like this:
With the above code, we’ve bound the picker value to a property with @bind-value, as well as specified a format for the date, a range of valid dates with Min and Max, a placeholder and a width. The result is the following:
Using the component helps provide a consistent visual style throughout the application, rather than relying on each browser’s styles.
Adding Numeric Fields Using the TelerikNumericTextBox
Another component we can use to accept number inputs is the TelerikNumericTextBox. It is much more powerful than a InputNumber, allowing you to define numeric formats, specify the number of decimal places, enable a clear button, among other features.
Here’s an example of its use:
The component in action looks as follows:
Selecting Colors Thanks to the TelerikColorPicker
Now let’s talk about some components that don’t have a native equivalent in Blazor. The first of these is the TelerikColorPicker, which allows selecting a color using a visual picker, in addition to including a predefined color palette and an HSV canvas. This enables precise color selections.
The implementation looks similar to the following:
In the code above we specify that the value will be stored in RGB format. The result of running it is the following:
Another thing I want to highlight is the ease of use of the Telerik UI for Blazor components, since you can see that by defining a couple of parameters we have a fully functional implementation. This avoided the need to use JavaScript interoperability or an external library.
Evaluating Satisfaction with the TelerikRating
Another component that has no native equivalent, but is certainly required in a large number of apps, is TelerikRating, which allows the user to provide a rating via a visual star system. Its use is quite simple:
In the code above, we use the Max parameter to indicate the maximum number of stars. One advantage of the component is that its value will be updated automatically when clicking on a star. It also has built-in keyboard support and accessibility. Let’s see the result:
If we had wanted to create the component manually, we would probably have had to handle SVG files, events and accessibility logic.
Displaying the Form Result
To complete the form, we are going to add a couple of buttons of type TelerikButton, as well as a panel to show the summary of the selected data:
Additionally, we will add a side column in which we will show the summary when the user clicks the Save Profile button:
The code above allows us to validate that the data binding between controls and properties works correctly, as well as to demonstrate how easy it is to obtain information from the form using Telerik components:
With this implementation, we have created a form that allows users to enter information quickly and reliably, thanks to the Telerik for Blazor controls.
Conclusion
Throughout this article, you’ve been able to learn first-hand about some Telerik editor-like components that can help you improve the user experience. These components offer settings and customizations that adapt to any type of application, and they are constantly updated.
Another point to highlight is that the components’ documentation is quite comprehensive, allowing you to learn all their features in detail. It’s time to improve your users’ experience by using these components.
Try Telerik UI for Blazor












