Topic: Template or HTML in Toast

MikeOnline priority asked 3 years ago

I am trying to use a Toast / Notification with a custom message using HTML, the Angular docs ( for notations list an option of "enableHtml" but how does this work? and is this the right option to allow custom html in the toast/notification message?

Can it be done?

Konrad Stępień staff answered 3 years ago

Hi @MikeOnline,

Yes, you can provide HTML like this:


<a mdbBtn color="info" class="waves-light" (click)="showInfo()" mdbWavesEffect>Info message</a>


showInfo() {'<b>Success</b> message', '', { enableHtml: true });

But remember, this option is "unsafe" because you can provide too many elements along with styles which can spoil the notification view

Please insert min. 20 characters.


Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.



Specification of the issue

  • ForumUser: Priority
  • Premium support: Yes
  • Technology: MDB Angular
  • MDB Version: 9.3.1
  • Device: Laptop
  • Browser: *ium
  • OS: Windows 10
  • Provided sample code: No
  • Provided link: Yes