Change textbox border color when selected

I tried to follow the documentation link but it doesn't seem to work.

My request is very basic, I need to change the border color of my textbox when it's selected, from the current reddish one to something else. What css should I target? I'm also using a floating label but it shouldn't matter


3 Replies 1 reply marked as answer

PK Priyanka Karthikeyan Syncfusion Team July 31, 2025 12:09 PM UTC

Hi Corrado Di Blasio,


Thank you for reaching out to us!

To customize the border color of the textbox when it receives focus, please refer to the CSS styles provided below. These styles target the appropriate elements to achieve the desired effect:

 

​.e-float-input:not(.e-input-group) .e-float-line::before, .e-float-input:not(.e-input-group) .e-float-line::after ,
.e-float-input.e-input-group:not(.e-float-icon-left).e-input-focus .e-float-line::before,
.e-float-input.e-control-wrapper.e-input-group:not(.e-float-icon-left) .e-float-line::after {
background: blue;
}

 


Sample: https://stackblitz.com/edit/angular-isbmyj-zstqnudp?file=src%2Fapp.component.html,src%2Fapp.component.css,package.json,src%2Findex.html

 

We appreciate your feedback and would like to inform you that we will be updating our documentation accordingly. The correction will be reflected in one of our upcoming releases.

Please feel free to reach out if you have any further questions or need additional assistance.


Regards,

Priyanka K



CD Corrado Di Blasio August 3, 2025 09:56 AM UTC

Thank you, the snippet provided works but in my application I had to add ::ng-deep to bypass Angular's ViewEncapsulation


Marked as answer

PK Priyanka Karthikeyan Syncfusion Team August 4, 2025 06:35 AM UTC

Hi Corrado Di Blasio,


Thanks for the update. Yes, using ::ng-deep is a handy way to override styles when ViewEncapsulation is in place. Glad to hear the snippet worked for you!

Please feel free to reach out if you have any further questions or need additional assistance.


Regards,

Priyanka K


Loader.
Up arrow icon