v1.2.0

Alert

Alerts display short, important messages to the user without interrupting their workflow.

Severity

This is an error alert — check it out! This is a warning alert — check it out! This is an info alert — check it out! This is a success alert — check it out!
<me-alert severity="error">This is an error alert.</me-alert> <me-alert severity="warning">This is a warning alert.</me-alert> <me-alert severity="info">This is an info alert.</me-alert> <me-alert severity="success">This is a success alert.</me-alert>

Filled Variant

This is a filled error alert. This is a filled warning alert. This is a filled info alert. This is a filled success alert.

Outlined Variant

This is an outlined error alert. This is an outlined warning alert. This is an outlined info alert. This is an outlined success alert.

With Title

Something went wrong — please try again. Your changes have been saved.
<me-alert severity="error" title="Error">Something went wrong.</me-alert>

Closable

Click the ✕ button to dismiss. The alert fires a me-close event — your code removes it.

This alert can be dismissed. This one has a title too.
<me-alert severity="info" closable>This alert can be dismissed.</me-alert> <script> document.querySelectorAll('me-alert[closable]').forEach(alert => { alert.addEventListener('me-close', () => alert.remove()); }); </script>

API

AttributeTypeDefaultDescription
severityerror | warning | info | successinfoAlert severity and icon.
variantstandard | filled | outlinedstandardVisual style.
titlestringBold heading above the message.
closablebooleanfalseShows a dismiss button.

Events

EventDescription
me-closeFired when the close button is clicked.

Slots

SlotDescription
defaultAlert message content.
actionOptional action elements (e.g. buttons).