Display
Countdown <pm-countdown>
Countdown to a date and time (a launch, an offer ending, a session expiring).
Offer ends in
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
| Attribute | Type | Default | Description |
|---|---|---|---|
to | string | — | Target time: an ISO date-time ("2027-01-01T00:00:00Z"), or a number of seconds from now ("90"). |
label | string | — | 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"). |
units | string | — | 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
| Event | React / Svelte prop | Description |
|---|---|---|
pm-complete | onPmComplete | The target time was reached. |
Slots
| Slot | Description |
|---|---|
(default) | Shown instead of the numbers once the time has passed. |