force-showToast - lightning-msg

force:showToast Message Display In Multiple Lines In Salesforce Lightning Component

Lightning Component

Hello guys, today in this post i am going to share a workaround for salesforce lightning force:showToast event to display toast message in multiple lines.

In javaScript string we can use /n escape characters for insert a newline in string. so i have used /n in ‘force:showToast’ event message(string type) attribute, like following code in lightning component javaScript controller :

but still getting no result. 🙁  [display in single line]

single-line toast



This event is handled by the container. It’s supported in Lightning Experience, Salesforce app, and Lightning communities.

Solution/Workaround :

create a external CSS file with following code :

next upload this CSS file in static resource and reference in your lightning component using ltng:require tag.

Check Also : Alternate/Workaround for contains() function in aura:if Condition in Lightning Component
JavaScript Controller :



Happy Learning 🙂

Related Resource :

showToast Doc


(Visited 5,430 times, 29 visits today)


Leave a Reply