Calm motion: animations on this site only fade, with no movement
Countdown banner
A strip with the time left to an event, and a link
Shows the time left to an event at the top of a page, for example a live recording or a launch. At the start, the banner says "Live now". It is a banner with a clock in it. For a timer that a person starts, use the timer.
Basic
Live recording of episode 50Starts in--
vue
<template>
<BlessCountdownBanner :to="start" title="Live recording of episode 50" label="Next event">
<template #action>
<BlessButton size="sm" variant="outline" href="#">Get a ticket</BlessButton>
</template>
</BlessCountdownBanner>
</template>
<script setup lang="ts">
import { BlessButton, BlessCountdownBanner } from "blessing-ui";
// the live recording starts three days and a bit from the moment the page opens
const start = Date.now() + ((3 * 24 + 5) * 60 + 42) * 60_000;
</script>tois the start of the event, as a Date, a timestamp in ms, or a date string.titlesays what starts.- The clock shows days, hours, minutes, and seconds. Under one day, it leaves out the days. At the start, it changes to "Live now" and emits
start. - The clock runs after the page loads, because the server does not know the time of the reader.
nowsets a fixed moment, for example in a test. - The
actionslot holds a button or a link. The props of the banner pass through:color,dismissible,persist,label, andv-modelfor open. - The clock does not speak every second. Screen readers hear the date of the start, such as "Starts Saturday, November 28, 2026 at 7:30 PM".
localesets the language of that date (default English). - Change the words with
labelsor a label pack:startsIn,live,days,hours,minutes,seconds, andstartsAt(a function of the date).
Usage
ts
import { BlessCountdownBanner } from "blessing-ui";API
Props
| Name | Type | Default | Description |
|---|---|---|---|
to* | string | number | Date | — | the start of the event: a Date, a timestamp in ms, or a date string |
title* | string | — | what starts, for example "Live recording of episode 50" |
locale | string | "en" | the language of the date for screen readers |
now | number | Date | — | a fixed "now", for example in a test; with it the clock does not run |
labels | Partial<{ startsIn: string; live: string; startsAt: (date: string) => string; days: string; hours: string; minutes: string; seconds: string; }> | — |
Events
| Name | Payload | Description |
|---|---|---|
start | [] |
Slots
| Name | Scope | Description |
|---|---|---|
action | — |