0

Is there any way to display HTML in a Toast popup?

I'd like to display a list of error messages, and not just a single string.

1
  • 1
    I am afraid that this is not possible.
    – Damecek
    Sep 15, 2021 at 14:11

1 Answer 1

1

Toast event can only have string message. Even if you try to pass html in message, it will be interpreted as text. You can use multiple toast events to show all the errors you have. Or, you can create your own toast component using the lightningdesignsystem toast blueprint. Add a slot inside the div with class slds-notify__content. You can add it wherever you want and control its rendering with the if:true directive.

<div class="slds-notify__content">
  <slot></slot>
</div>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.