Fine-tune light, shadows, borders, neumorphic
Light and shadows
Borders
Neumorphic
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>.

Full screen
Version 2 is here. See what changed Scheduled maintenance on Sunday, 02:00 to 03:00 UTC.Details

Props

<script type="module"> import '@prismora/css'; import '@prismora/elements/banner'; import '@prismora/elements/button'; import '@prismora/elements/icon'; import { registerIcons } from '@prismora/elements/icon'; import { alertTriangle, sparkles } from '@prismora/icons'; registerIcons([alertTriangle, sparkles]); </script> <pm-banner tone="info" icon="sparkles" dismissible> Version 2 is here. <a href="/docs">See what changed</a> </pm-banner> <pm-banner tone="warning" variant="solid"> <pm-icon slot="icon" name="alert-triangle"></pm-icon> Scheduled maintenance on Sunday, 02:00 to 03:00 UTC. <pm-button slot="actions" size="xs" tone="neutral">Details</pm-button> </pm-banner>

Variants

Set with the variant attribute.

Version 2 is here. See what changed
variant="soft"
Version 2 is here. See what changed
variant="solid"

Tones

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

Version 2 is here. See what changed
tone="accent"
Version 2 is here. See what changed
tone="secondary"
Version 2 is here. See what changed
tone="neutral"
Version 2 is here. See what changed
tone="success"
Version 2 is here. See what changed
tone="warning"
Version 2 is here. See what changed
tone="danger"
Version 2 is here. See what changed
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

AttributeTypeDefaultDescription
iconstring—Registered icon name (see registerIcons).
variant'soft' | 'solid'—Visual style.
dismissibleboolean—Show a close button.
stickyboolean—Stay at the top of the page while scrolling.
storage-key
prop: storageKey
string—Remember the dismissal in localStorage under this key.
liveboolean—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

EventReact / Svelte propDescription
pm-dismissonPmDismissThe close button was pressed (cancelable).

Slots

SlotDescription
(default)Message; links are styled.
iconCustom icon.
actionsButtons after the message.