We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Active state

I am styling the sidebar and I would like to know how to add an active class to the current selected <li> based on what component imported the sidebar component. Any help would be appreciated.

Regards

1 Reply

AB Ashokkumar Balasubramanian Syncfusion Team April 4, 2019 09:22 AM UTC

Hi Rikard, 
 
We have checked your query at our end. We suspect that, you have followed the below sample to create the application. For this sample, we are not customizing the active li element styles in application level, so only you are not able to identify which component you are selected.  
 
 
Our ListView component, we were able to differentiate each state (hover, active, default). So, you can use the e-active class to customize the corresponding styles for selected component.    
 
//menuList is a id of ListView component 
 
#menuList.e-listview .e-list-item.e-active
        background: green; 
} 
 
Please let us know, If the provided information’s are helpful to resolve your problem or not. If not, please share the screenshot of your problem or sample. 
 
Regards, 
Ashokkumar B. 


Loader.
Live Chat Icon For mobile
Up arrow icon