Calm motion: animations on this site only fade, with no movement
Banner
Page-wide announcement bar
A bar for one message to the whole page: a new version, planned maintenance, a cookie notice. For a message about one part of the page, use Alert. For a message that goes away by itself, use Toaster.
Basic
Version 0.4 is out.
Planned maintenance on Friday, 02:00 UTC.
vue
<template>
<div style="display: grid; gap: 1rem">
<BlessBanner>
Version 0.4 is out.
<template #action
><BlessButton size="sm" variant="outline" href="#">Read more</BlessButton></template
>
</BlessBanner>
<BlessBanner color="warning">Planned maintenance on Friday, 02:00 UTC.</BlessBanner>
<BlessBanner color="danger" persist="bless-demo-banner">
You can dismiss this one. It stays gone on your next visit.
</BlessBanner>
</div>
</template>
<script setup lang="ts">
import { BlessBanner, BlessButton } from "blessing-ui";
</script>- It is ink by default.
danger,infoandwarningfill the bar for status. There is no accent color, because color means chosen. dismissible(default) adds a close button.v-modelholds the open state anddismissfires on close.persistis alocalStoragekey. When a visitor dismisses the banner, it stays gone on the next visit. Withpersist, the banner shows after mount, because the server cannot know what the visitor dismissed.- The
#actionslot holds a button or a link at the end of the bar. - It is a labelled region (
label, "Announcement" by default). It is not a live region, so it does not interrupt a screen reader.
Usage
ts
import { BlessBanner } from "blessing-ui";API
Props
| Name | Type | Default | Description |
|---|---|---|---|
color | "text" | "danger" | "warning" | "info" | "text" | |
dismissible | boolean | true | |
persist | string | — | a `localStorage` key. A dismissed banner stays gone on the next visit. |
label | string | "Announcement" | names the region |
labels | Partial<{ close: string; }> | — | |
modelValue | boolean | true |
Events
| Name | Payload | Description |
|---|---|---|
update:modelValue | [value: boolean] | |
dismiss | [] |
Slots
| Name | Scope | Description |
|---|---|---|
default | — | |
action | — |