Fine-tune light, shadows, borders, neumorphic
Light and shadows
Borders
Neumorphic
Display

Countdown <pm-countdown>

Countdown to a date and time (a launch, an offer ending, a session expiring).

Full screen

Offer ends in

Props

<script type="module"> import '@prismora/css'; import '@prismora/elements/countdown'; </script> <pm-countdown to="1036800" label="Launch in"></pm-countdown> <p> Offer ends in <pm-countdown to="5400" variant="inline" units="h,m,s" label="Offer ends in"></pm-countdown> </p>

Variants

Set with the variant attribute.

variant="blocks"
variant="inline"

Sizes

Set with the size attribute; controls keep touch-sized targets on phones.

size="sm"
size="md"

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

Shows days, hours, minutes and seconds, updates every second and fires pm-complete at zero. Screen readers get the remaining time once a minute, not every second.

Attributes

AttributeTypeDefaultDescription
tostring—Target time: an ISO date-time ("2027-01-01T00:00:00Z"), or a number of seconds from now ("90").
labelstring—Accessible name, e.g. "Offer ends in".
size'sm' | 'md'—Size: sm or md (md when not set).
variant'blocks' | 'inline'—blocks (default: big numbers with labels) or inline (fits in a sentence: "2d 4h 10m 5s").
unitsstring—Which units to show, largest first (default "d,h,m,s").

Also accepts the contextual attributes tone, surface, radius, density, motion, elevation. They are inherited from ancestors' data-* attributes.

Events

EventReact / Svelte propDescription
pm-completeonPmCompleteThe target time was reached.

Slots

SlotDescription
(default)Shown instead of the numbers once the time has passed.

Used in templates

Coming soon