Display
Banner <pm-banner>
Banner: a page-wide announcement bar above the content (maintenance, a new release, a trial ending, cookie notice). For a message inside the page, use <pm-alert>.
Variants
Set with the variant attribute.
variant="soft"variant="solid"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"Overview
dismissible adds a close button; with storage-key the dismissal is remembered in this browser, so the banner stays closed on the next visit. sticky keeps it at the top while scrolling.
Attributes
| Attribute | Type | Default | Description |
|---|---|---|---|
icon | string | — | Registered icon name (see registerIcons). |
variant | 'soft' | 'solid' | — | Visual style. |
dismissible | boolean | — | Show a close button. |
sticky | boolean | — | Stay at the top of the page while scrolling. |
storage-keyprop: storageKey | string | — | Remember the dismissal in localStorage under this key. |
live | boolean | — | Announce to screen readers when it appears. |
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 | The close button was pressed (cancelable). |
Slots
| Slot | Description |
|---|---|
(default) | Message; links are styled. |
icon | Custom icon. |
actions | Buttons after the message. |