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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Can't use 3rd party icon with toast

Thread ID:





143995 Apr 13,2019 01:38 AM UTC Apr 15,2019 07:23 AM UTC Angular - EJ 2 1
Tags: Toast
Tareq Perez
Asked On April 13, 2019 01:38 AM UTC

I'm trying to incorporate a font-awesome icon with the toast message but there doesn't seem to be a way to override the default "e-toast-icon e-icons" class. I can't use a custom template because I have dynamic data needs to be incorporated and i don't want to have to dynamically compile the template.

Is there any way to override the entire css class of the icon div?

Prince Oliver [Syncfusion]
Replied On April 15, 2019 07:23 AM UTC

Hello Tareq, 

Thank you for contacting us. 

Third party icons are supported in the Toast component. We have checked your shared example, to use the third-party icons, you need to refer the font-awesome library next to the EJ style reference as shown below. 

<link rel='nofollow' href="//cdn.syncfusion.com/ej2/material.css" rel="stylesheet" /> 
<!--  Refer the font-awesome library --> 
<link rel="stylesheet" rel='nofollow' href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">  

Now, you can refer the font-awesome icons in the toast component using icon property. 

public toasts: { [key: string]: Object }[] = [ 
    { title: 'Success!', cssClass: 'e-toast-success', icon: 'fa fa-check', timeOut: 80000 }, 

We have attached a modified example for your reference, please find it in the following location 

Let us know if you need any further assistance on this. 



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon