Any UI control that captures the user's attention can be thought of as an alert. They should be used wisely so they aren't overwhelming.
For the purposes of this guide, alerts are characterized by being interruptive and requiring action to proceed, unlike notifications or validation messages.
Every alert guideline says to use alerts sparingly. Overwhelming users with alerts dilutes their importance and annoys users. The Microsoft Windows Application Design Guidelines suggest when to use alerts this way: "Don't overwarn. Limit warnings to conditions that involve risk and are immediately relevant, actionable, not obvious, and infrequent. Otherwise, remove or rephrase the message."
It lists specific reasons for using alerts, such as:
Here are some examples:
The macOS Human Interface Guidelines are succinct in their guiding principle: "When an alert is necessary, your most important job is to explain the situation clearly and give users a way to handle it."
Similar to validation message, alerts can be used to communicate errors or provide warnings about potentially destructive actions. Unlike validation, however, alerts should generally not be used for success messages, unless it is to notify that an important action has completed.
As shown above, alerts vary by operating system and platform. Most software platforms provide built-in alert components. It is best to use default system styles for alerts. Some operating systems allow for icons and/or color to differentiate states or types of alerts.