Skip to content

Circular Countdown Timer

Countdown timer with glowing SVG rings for days, hours, minutes and seconds that shrink as time runs out. Pure CSS with a small vanilla JS file.

Also known as: countdown timer rings, circular countdown, launch countdown timer, event countdown widget, days hours minutes seconds countdown

Circular Countdown Timer live demo

Open in new tab

Pure CSS code (HTML, CSS, JS)

A circular countdown timer where days, hours, minutes and seconds are shown as glowing SVG rings that shrink as time runs out. It is built with plain CSS and a small vanilla JavaScript file, and fits launch pages, event sites, sales banners and coming soon sections.

How it works

The root section.ccd-timer stores the target date in data-target (ISO 8601). Inside .ccd-grid there are four .ccd-unit elements, each marked with data-unit (days, hours, minutes or seconds). Every unit holds an SVG .ccd-ring with two circles: a faint .ccd-track and a colored .ccd-progress, plus the number .ccd-value and the .ccd-label.

The progress circle uses pathLength="100", so its stroke-dasharray is simply 100 and the visible arc equals 100 - stroke-dashoffset percent. The SVG is rotated by -90deg so the arc starts at twelve o'clock. Once per second the script calculates the remaining time and sets each ring's strokeDashoffset: hours against 24, minutes and seconds against 60, and days against data-max-days. A linear CSS transition makes the arcs shrink smoothly. When a unit wraps around (for example seconds going from 00 back to 59), the ring gets the .is-refilling class so it refills quickly instead of spinning backwards.

If data-target is missing or already in the past, the timer counts down from page load using data-fallback-days and writes the computed date into the time.ccd-time element. At zero the interval stops, the root gets .is-done and the .ccd-done message is shown.

Customization

  • data-target on .ccd-timer: the launch moment, e.g. 2027-03-15T09:00:00Z. Update the text of .ccd-time to match.
  • data-max-days: the number of days that equals a full days ring; it grows automatically if more days remain.
  • data-fallback-days: how far ahead the demo countdown runs when the target date has passed.
  • --ccd-days, --ccd-hours, --ccd-minutes and --ccd-seconds: the ring and label color of each unit.
  • --ccd-ring-size: diameter of the rings; the numbers scale with it. It is 7.5rem on phones and 9.5rem from 640px.
  • --ccd-stroke: thickness of the rings, for example 4 for a thinner, more elegant look.
  • --ccd-bg and --ccd-bg-2: the dark background and the glow at the top of the card.
  • Remove the filter: drop-shadow line in .ccd-progress for flat rings without the neon glow.

Use cases

  • Launch pages: glowing rings for days, hours, minutes and seconds count down to release
  • Event sites: show time remaining until a conference or party with a done message at zero
  • Sales banners: a neon countdown adds urgency to limited-time offers
  • Coming soon sections: if the date has passed, the demo counts down from page load
  • Accessible pages: a screen reader sentence updates every minute instead of every second

Accessibility

The visual grid is aria-hidden, because numbers that change every second are noisy for screen readers. Instead, the hidden .ccd-sr paragraph with role="timer" holds a sentence such as "77 days, 10 hours and 22 minutes remaining". It is updated only when the minute changes, and role="timer" keeps it from being announced automatically, so users can read it whenever they want. The launch date is a semantic time element. Text contrast on the dark navy background meets WCAG AA. With prefers-reduced-motion: reduce the ring transitions are switched off.

Usage notes

Several timers can share a page; each .ccd-timer reads its own attributes and keeps its own interval. Times are calculated from the visitor's clock, so add a server timestamp if the countdown must be exact.

Circular Countdown Timer at a glance

Framework
Pure CSS
Code
HTML, CSS, JavaScript
JavaScript
Vanilla JavaScript, no jQuery
Dependencies
None
Layout
Responsive, works on mobile, dark design
Category
Countdown Timers
License
Free for personal and commercial use

Questions about this template

Can I use the Circular Countdown Timer code for free?

Yes. You can copy or download the code and use it in personal and commercial projects, including client work. No sign-up is needed. Reselling it as part of a component library or template collection is not allowed; see the license.

How do I add it to my website?

There is nothing to install. Paste the HTML where the component should appear, add the CSS to your stylesheet and load the JavaScript before the closing </body> tag. Download HTML gives you a complete page with everything already linked.

Does it need jQuery or a JavaScript framework?

No. The script is plain vanilla JavaScript, so it works without jQuery, React or Vue. You can still use the markup inside those frameworks.

Does it work on mobile?

Yes. The layout adapts to small screens. Use the Mobile and Tablet buttons above the live demo to check it at phone and tablet width.

Requirements

No dependencies. Pure HTML, CSS and JavaScript.

Circular Countdown Timer – Pure CSS countdown timers component screenshot
Circular Countdown Timer · Pure CSS Countdown Timers

More Countdown Timers

Launch Countdown Card – Bootstrap 5 countdown timers preview

Launch Countdown Card

Bootstrap 5 countdown card for product launches with a reminder button.

Countdown Sale Banner for Shopify – Shopify countdown timers preview

Countdown Sale Banner for Shopify

A Shopify section that counts down to one fixed end date, as a full banner or slim bar, with an optional discount code to copy and a clean ended state.

Flip Countdown – Tailwind CSS countdown timers preview

Flip Countdown

Tailwind CSS flip-clock countdown timer with 3D split-flap cards for days, hours, minutes and seconds, reduced-motion support and a completion event.

Countdown Timer Cards – Pure CSS countdown timers preview

Countdown Timer Cards

Pure CSS countdown with days, hours, minutes and seconds in flip-style cards.