Countdown

Display time remaining with various styles and animations
Class Reference

Basic

Control the displayed value by updating the '--value' CSS variable with JS (range: 0-99) ex:

let countdownValue = 60;
const countdownElement = document.querySelector('.countdown span');

// Update every second
const interval = setInterval(() => {
    countdownValue = Math.max(0, countdownValue - 1);
    
    if (countdownValue === 0) {
        countdownValue = 60; // Reset
    }    
    countdownElement.style.setProperty('--value', countdownValue);
}, 1000);

Basic Countdown

Large text

Clock Style

Clock Style

hms

Clock with colons

::

Labeled

Labeled inline

days
hours
min
sec

Labeled under

days
hours
min
sec

In boxes

days
hours
min
sec

Class Reference

Class Type Description
countdown Component Base countdown container
Do you have a question? ask the community
Do you see a bug? open an issue on GitHub