Skip to main content

Banner

Full-width system message at the top of the app shell.

Marmot will be read-only from 22:00 to 23:00 UTC on 2 November while the catalog is upgraded to v0.9.
<mm-banner tone="info" href="/docs/releases/0.9" link-text="Read the release notes" dismissible>
Marmot will be read-only from 22:00 to 23:00 UTC on 2 November while the catalog is upgraded to v0.9.
</mm-banner>

Guidance​

The system banner runs full width across the top of the app shell for messages that apply to the whole instance, such as the server-configured banner in Marmot OSS or planned maintenance. An icon, one sentence, an optional link and an optional dismiss button, on a soft status fill or mm-sunken, closed by a hairline rule. No stripe. One banner at a time.

It is a labelled region, so people can jump to it. With dismissible, the close button fires mm-dismiss and hides the banner unless cancelled; persist the choice yourself.

Properties​

PropertyAttributeTypeDefaultDescription
tonetoneBannerTone'info'info (default), warning or danger.
surfacesurface'soft' | 'sunken''soft'soft status fill (default) or sunken, for quieter notices.
hrefhrefstring''Optional link URL, e.g. the status page or release notes.
linkTextlink-textstring''Link text, e.g. "Read the release notes".
dismissibledismissiblebooleanfalseShows a close button that fires mm-dismiss.
labellabelstring''Accessible name of the region. Defaults to "System message".

Methods​

MethodDescription
dismiss()Dismisses the banner as if the close button were pressed.

Events​

EventDetailDescription
mm-dismissCustomEvent<{ tone: string }>The close button was activated. Cancel it to keep the banner.

Slots​

SlotDescription
DefaultThe message.

CSS parts​

PartDescription
bannerThe bar.
iconThe status icon.
messageThe message.
linkThe link.
dismissThe close button.

Examples​

Every state of mm-banner in Storybook, with keyboard and screen reader tests.