Alerts

Alerts are used to communicate important messages to users, providing context through different styles and interactive elements.

Basic Alert

The most simple version of an alert displays a message with default styling. Use this when you need to show general information without emphasizing its nature.

Basic Alert

100%
This is a basic info alert

Alert Types

Alerts come in different types to convey different meanings: info, success, warning, and error. Add icons to make them more visually distinctive.

Alert with Icon and Type

100%
Your changes have been saved successfully

Interactive Alerts

Add action buttons to your alerts when users need to take specific actions. Actions appear as buttons or links and can trigger different behaviors.

Alert with Actions

100%
Your trial period is ending soon Upgrade Now Learn More

Rich Content

Alerts can contain rich HTML content including headings, paragraphs, and other elements. This is useful for more complex messages that need better structure.

Alert with Rich Content

100%

Important Notice

Your account will be suspended in 3 days if you don't update your payment information.

Update Payment

Dismissible Alerts

Add the dismissible attribute to allow users to dismiss alerts. This is useful for temporary messages or notifications that don't need to persist.

Dismissible Alert

100%
There was an error processing your request Contact Support

API Reference

Properties

Property Type Default Description type string 'info' Alert type: 'info', 'success', 'warning', 'error' icon string - Name of the icon to display dismissible boolean false Whether the alert can be dismissed

Events

Event Description dismiss Fired when a dismissible alert is closed

Best Practices

  • Use appropriate alert types to match the message's importance
  • Keep alert messages clear and concise
  • Include actions only when users need to take specific steps
  • Use dismissible alerts for temporary messages that don't need to persist
  • Consider using icons to enhance visual recognition
Pro tip: Combine alerts with other components like buttons or links to create more interactive notifications.