Skip to content
IndexRequest a UIAboutContact

Countdown Timer Ring

A circular countdown with presets, start, pause and reset, whose ring empties as time runs down.

Open alone ↗

AI prompt

PROMPT: PASTE INTO YOUR AI CODING TOOL
Clean UI mockup of a circular countdown timer, a thick light grey ring with a blue arc covering about 40 percent draining clockwise from the top, the large digits 00:12 in the centre with the small label seconds left, three small preset chips 10 s, 30 s, 1 min below and round Start and Reset buttons, light theme, flat modern style. Variant: the finished state with a full green ring and a check mark. Negative: heavy gradients, 3D, clutter, text errors. Reduced motion: static design.

About this pattern

Definition

A ring timer shows time left as a circle that empties, with the digits in the middle. It is quick to read at a glance. The ring is an SVG circle whose stroke-dashoffset follows the remaining fraction, and the digits give the exact time for precision and for assistive technology.

Purpose & UX principles

  • Use pathLength 1 on the circle so the offset equals the fraction elapsed.
  • Rotate the circle so it starts at the top and drains clockwise.
  • Update from timestamps (performance.now), not by counting intervals, so it stays accurate when the tab is throttled.
  • At zero, show a clear finished state and keep it until reset.

Interaction states

  • Presets 10 s, 30 s and 1 min; Start, Pause and Reset.

Motion specification

  • The ring drains smoothly; at the end the ring pulses once.
  • Reduced motion: no pulse and the ring updates once per second.

Responsive behaviour

  • Give the container role timer and do not announce every second; announce only at the end.
  • Provide Pause and Reset as real buttons.

Code

HTML
<div class="bx"><div class="pre" id="pre" role="group" aria-label="Duration"><button data-p="0" aria-pressed="true">10 s</button><button data-p="1" aria-pressed="false">30 s</button><button data-p="2" aria-pressed="false">1 min</button></div><div class="tm" id="tm" role="timer" aria-label="Countdown"><svg viewBox="0 0 120 120" aria-hidden="true"><circle cx="60" cy="60" r="50" fill="none" stroke="#e6e6e2" stroke-width="10"/><circle id="rg" cx="60" cy="60" r="50" fill="none" stroke="#2f6bff" stroke-width="10" stroke-linecap="round" pathLength="1" stroke-dasharray="1" stroke-dashoffset="0" transform="rotate(-90 60 60)"/></svg><b id="dg">00:10</b></div><div class="two"><button class="mini" id="go" type="button">Start</button><button class="mini" id="rs" type="button">Reset</button></div><p class="out" id="out" role="status"></p></div>

Related patterns

Indeterminate to Determinate Progress

↗
Indeterminate to Determinate ProgressLoading & Progress

Undo Countdown Toast

↗
Undo Countdown ToastFeedback & Notifications

Progress Indicator

↗
Progress IndicatorLoading & Progress