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>