Display
Alert <pm-alert>
Inline alert / callout. Not a live region by default; set live for dynamic messages.
Variants
Set with the variant attribute.
variant="soft"variant="solid"variant="outline"Tones
Set tone on the element, or data-tone on any ancestor to tone a whole area.
tone="accent"tone="secondary"tone="neutral"tone="success"tone="warning"tone="danger"tone="info"Attributes
| Attribute | Type | Default | Description |
|---|---|---|---|
icon | string | — | Registered icon name (see registerIcons); an icon slot overrides it. |
heading | string | — | Title above the body. |
variant | 'soft' | 'solid' | 'outline' | — | Look: soft, solid or outline. |
dismissible | boolean | — | Show a close button; the alert hides itself and fires pm-dismiss. |
live | boolean | — | Announce the alert to screen readers when it appears (role="alert"). |
dismiss-labelprop: dismissLabel | string | Dismiss | Accessible name of the close button (default "Dismiss"). |
Also accepts the contextual attributes tone, surface, radius, density, motion, elevation. They are inherited from ancestors' data-* attributes.
Events
| Event | React / Svelte prop | Description |
|---|---|---|
pm-dismiss | onPmDismiss | When the close button is pressed (cancelable). |
Slots
| Slot | Description |
|---|---|
icon | Custom icon (default depends on tone). |
(default) | Body. |
actions | Trailing actions. |
Used in templates
Overview dashboardTraffic analyticsOrdersCustomer 360NotificationsBilling and invoicesAccount settingsSign inCreate accountTwo-step verificationCheckoutChangelogContact