Activity Forums Salesforce® Discussions What is the use of lightning:messages in salesforce lightning component?

  • What is the use of lightning:messages in salesforce lightning component?

    Posted by Nikita on September 24, 2019 at 1:03 pm

    What is the use of lightning:messages in salesforce lightning component?

    Saddam replied 5 years, 2 months ago 3 Members · 2 Replies
  • 2 Replies
  • Piyush

    Member
    September 25, 2019 at 5:05 am

    Hi NIkita,

    The severity attribute indicates a message's severity level and determines the style to use when displaying the message. If the closable attribute is set to true, the message can be dismissed by pressing the × symbol. To apply Lightning Design System styling, we recommend that you use lightning:notificationsLibrary instead of ui:message.

    Ex:-

    <aura:component access="global">
    	<ui:message title="Confirmation" severity="confirm" closable="true">
    			This is a confirmation message.
    	</ui:message>
    	<ui:message title="Information" severity="info" closable="true">
    			This is a message.
    	</ui:message>
    	<ui:message title="Warning" severity="warning" closable="true">
    			This is a warning.
    	</ui:message>
    	<ui:message title="Error" severity="error" closable="true">
    			This is an error message.
    	</ui:message>
    	
    </aura:component>

     

  • Saddam

    Member
    September 25, 2019 at 7:01 am

    Hi,

    you can use this component inside lightning:recordEditForm to display message either is success or error

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos