Fine-tune light, shadows, borders, neumorphic
Light and shadows
Borders
Neumorphic
Display

Alert <pm-alert>

Inline alert / callout. Not a live region by default; set live for dynamic messages.

Full screen
A new version is available.Update Update your card to keep your plan. All 248 files are safe.

Props

<script type="module"> import '@prismora/css'; import '@prismora/elements/alert'; import '@prismora/elements/button'; import '@prismora/elements/icon'; import { registerIcons } from '@prismora/elements/icon'; import { checkCircle } from '@prismora/icons'; registerIcons([checkCircle]); </script> <pm-alert tone="info" heading="Heads up"> A new version is available. <pm-button slot="actions" size="xs" variant="outline">Update</pm-button> </pm-alert> <pm-alert tone="danger" heading="Payment failed" dismissible>Update your card to keep your plan.</pm-alert> <pm-alert tone="success" heading="Backup complete"> <pm-icon slot="icon" name="check-circle"></pm-icon> All 248 files are safe. </pm-alert>

Variants

Set with the variant attribute.

A new version is available.Update
variant="soft"
A new version is available.Update
variant="solid"
A new version is available.Update
variant="outline"

Tones

Set tone on the element, or data-tone on any ancestor to tone a whole area.

A new version is available.Update
tone="accent"
A new version is available.Update
tone="secondary"
A new version is available.Update
tone="neutral"
A new version is available.Update
tone="success"
A new version is available.Update
tone="warning"
A new version is available.Update
tone="danger"
A new version is available.Update
tone="info"

Attributes

AttributeTypeDefaultDescription
iconstring—Registered icon name (see registerIcons); an icon slot overrides it.
headingstring—Title above the body.
variant'soft' | 'solid' | 'outline'—Look: soft, solid or outline.
dismissibleboolean—Show a close button; the alert hides itself and fires pm-dismiss.
liveboolean—Announce the alert to screen readers when it appears (role="alert").
dismiss-label
prop: dismissLabel
stringDismissAccessible 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

EventReact / Svelte propDescription
pm-dismissonPmDismissWhen the close button is pressed (cancelable).

Slots

SlotDescription
iconCustom icon (default depends on tone).
(default)Body.
actionsTrailing actions.

Used in templates

Overview dashboardTraffic analyticsOrdersCustomer 360NotificationsBilling and invoicesAccount settingsSign inCreate accountTwo-step verificationCheckoutChangelogContact