How to custom the close button ?


I have a server-side Blazor app using the SfTab.
How can I to set the size of the close button ? And,how  can I to custom the effect of the close button when hovering?

Thanks

3 Replies

SK Satheesh Kumar Balasubramanian Syncfusion Team August 19, 2021 02:44 PM UTC

Hi OuYuanbin, 
  
Thanks for using Syncfusion Products. 
  
We have validated your reported query "How to custom the close button" and suggest you to use the below customized style to achieve your requirement. For the same we have prepared a sample which can be downloaded from the following link. 
  
  
Index.razor:  
<SfTab ShowCloseButton="true" CssClass="customize-close-icon">
..........................................................
</SfTab>

<style>
    .customize-close-icon.e-tab .e-tab-header .e-toolbar-item .e-close-icon, .customize-close-icon.e-tab .e-tab-header .e-toolbar-item .e-close-icon::before {
        font-size: 15px;
    }
    .customize-close-icon.e-tab .e-tab-header .e-toolbar-item .e-close-icon:hover {
        color: red;
    }
</style>
  
Kindly try the above sample and let us know if this meets your requirement. 
  
Regards, 
Satheesh Kumar B 



OU OuYuanbin August 20, 2021 02:45 AM UTC

Thanks,it worked fine when I  customize the effect of the close button when hovering, but it didn't work when I set the font-size to 10px,  Is there a limit on the minimum size?



VD Vinitha Devi Murugan Syncfusion Team August 23, 2021 07:20 AM UTC

Hi OuYuanbin, 
 
Thanks for your update. 
 
We have validated your reported “it worked fine when I  customize the effect of the close button when hovering, but it didn't work when I set the font-size to 10px,  Is there a limit on the minimum size” issue at our end by modifying the icon size as 10px with below code. Since the icon size applied properly at our end. Please refer to the  below screenshot of working sample. 
 
 
.customize-close-icon.e-tab .e-tab-header .e-toolbar-item .e-close-icon.customize-close-icon.e-tab .e-tab-header .e-toolbar-item .e-close-icon::before { 
    font-size10px; 
} 
.customize-close-icon.e-tab .e-tab-header .e-toolbar-item .e-close-icon:hover { 
    colorred; 
} 
 
Output: 
 
 
Kindly refer the above sample, If you still facing the same problem share us the below details to serve your better.  
  • Replicate your problem in the above shared sample or
  • Share a sample illustrating the problem which would help us to proceed further.
Regards, 
Vinitha 


Loader.
Up arrow icon