Flash messages are used to provide feedback to the user after some event. Flash messages include lead send success or failures, user registrations, valuation leads sent and so on.
In its basic form, you have an empty div ready to be populated with a message:
An event and callback function is then registered to populate the container:
Note that you have access to the message contents and type, as well as full control over the position of the div, its styling and behaviour.