How to pass a custom class to a textbox label

1 Answer 5 Views
TextBox
Reagan
Top achievements
Rank 1
Reagan asked on 27 Jun 2025, 08:37 PM

I'm trying to apply a class to a textbox label like so:

<kendo-textbox name="customerNameTextbox" for="@Model.Name">
<textbox-label content="Name" class="required" />
</kendo-textbox>

However, I can see in the browser development console that the label component associated with the component only has the usual k- classes applied to it:

<label class="k-label k-input-label" for="Name">Name</label>

How can I make sure my class is applied to the label?

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 29 Jun 2025, 08:54 PM

Hello Reagan,

 

Thank you for reaching out.

Yes, this seems like a bug and I will log it in our system. Thank you for bringing it to our attention. I have updated your Telerik Points as a token of gratitude.

Meanwhile, you can use the following approach:

<div class="k-w-300 required-input">
CSS:
<style>
    .required-input > .k-input-label{
        background-color: lightblue;
    }
</style>
Here is a live sample I have prepared for your convenience:
https://netcorerepl.telerik.com/mJuUmXQu53JNRfga49

Can you please check it and let me know if you find it beneficial?

 

Regards,
Eyup
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
TextBox
Asked by
Reagan
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or