Skip to the content

Countdown

A countdown for a launch, the end of an offer or a weekly cut-off, written as one attribute that holds the date.

Become a member to unlock the full effect today.

Join now

Already a member? Sign in

Documentation

  1. Copy to Webflow

    Add Geist and Geist Mono to your site's fonts (Site settings, Fonts, Google Fonts) before pasting: Webflow removes any font your site has not installed.

  2. Add custom CSS

    The look of the preview is the countdown-* classes of the paste; the size of the figures is the font size of the box they are written in, a headline size for the box marked data-countdown-lead, a text size in a banner. The Embed draws the columns and swaps the two states, and reads three variables with a fallback, --countdown-quiet (the units), --countdown-unit-size (their size against the figure, the same by default) and --countdown-gap (the room between two units): set them on the count, or on anything above it, in a rule of your own. The preview centres the count; the figures are text in a box, so the alignment is the text alignment of that box, left, centred or right.
  3. Add custom JS

  4. Use it on your own elements

    Custom attributes
    Select the element on the canvas and open the Settings panel. Under Custom attributes, add a pair: the name on the left, the value on the right.
    Custom attributeWhat it does
    data-countdown Marks the box of a count, and its value is the date, written once: an ISO 8601 date with its offset, 2026-10-30T17:00:00-04:00, the same instant for every visitor. A date without offset is read on the clocks of data-countdown-zone. A time that really comes back is written 17:00, every day, or Fri 17:00, every week, with the zone. The settings below go on the same element.
    data-countdown-lead On a box inside the count. It takes no value. The engine writes in it the largest unit still running, with its word: 4 days, then 23 hours on the last day, 59 seconds in the last minute. Its text is what shows before the script, and on the Designer canvas: write the date in it. [ Optional ]
    data-countdown-rest On a box inside the count. It takes no value. The engine writes in it the units under the one written large, in one line. [ Optional ]
    data-countdown-time On a box inside the count. It takes no value. The engine writes every unit in it, in one line. With no box marked lead, rest or time, the box of the count itself is that line: a span in a sentence is enough. [ Optional ]
    data-countdown-local On a text inside the count. It takes no value. The engine rewrites it as the date in the visitor's own time zone and language. Its text is what shows without the script: write the date and its zone in it. [ Optional ]
    data-countdown-before On a block inside the count that leaves at zero. It takes no value. Put the boxes of the figures in it when there is a block for the end. [ Optional ]
    data-countdown-after On a block inside the count that waits for zero and takes the place of the first one. It takes no value. A page opened after the date shows it at once. On the Designer canvas, which runs no Embed, both blocks show, one under the other. [ Optional ]
    data-countdown-rehearse On a link, for a preview. Its value is a number of seconds: a click plays the count from that many seconds left, the count the link is in, or every count of the page when it is outside. Empty, it goes back to the date. Take these links out of a real page. [ Optional ]
    data-countdown-state Written by the engine on a mounted count: running, then done. data-countdown-ended is added when the end happened under the visitor's eyes, and data-countdown-ready once mounted. Never written by hand; the stylesheet reads them, and so can a rule of yours. [ Optional ]
    Settings
    Every setting is a custom attribute too, added the same way and on the same element. An attribute always wins over the defaults written in the code.
    AttributeDefaultWhat it is
    data-countdown-units days hours minutes seconds The units the count shows, largest first, parted by spaces. Options: any of days, hours, minutes, seconds. The largest one shown takes everything above it: without days, three days read 72 hours. The smallest one shown sets how often the figures change: without seconds, once a minute, and the count rounds up so it never shows zero before the end.
    data-countdown-labels short How a unit is written beside its figure, in the language of the page. Options: long (4 days, 6 hours), short (4 days, 6 hr, 12 min), narrow (4d 6h 12m). The box marked data-countdown-lead always takes the long word.
    data-countdown-zone empty The time zone of a date written without an offset, and of a time that comes back. Options: empty, for a date that carries its offset; or a name of the IANA list, America/New_York, Europe/Paris. Summer time is followed.
    data-countdown-locale empty The language the units are written in. Options: empty, the language of the page, read from the nearest lang attribute, then from the browser; or a tag, fr, de-CH, en-GB.
    data-countdown-done empty A word written where the figures were, at zero. Options: empty, and the figures stay at zero unless a block marked data-countdown-after takes their place; or a few words, Closed, We are open.
    data-countdown-roll 0.6 The time a column of seconds takes to turn, in seconds. Minutes take 1.25 times as long, hours 1.5, days 1.8.

What it does

Countdown is a site utility component for Webflow and vanilla JavaScript, with no library. Also called countdown timer, launch countdown timer or sale countdown timer.

A countdown for a launch, the end of an offer or a weekly cut-off, written as one attribute that holds the date. The time left is read from the clock at every look, never counted, so it cannot drift: a tab left in the background, a laptop put to sleep or a system clock set again come back to the right figures at once, with nothing catching up digit by digit. Each character sits in a window of its own. A second turns one column, calmly; when a unit runs out, the carry goes up the line, one column after the other from the right, each heavier wheel turning a little slower, so the eye reads how rare the passage is from how far the movement travels: one column for a second, the whole line for a day. The page chooses where the figures go: one line for a banner or a sentence, or the largest unit still running written large with its word, 4 days, then 23 hours on the last day and 59 seconds in the last minute, with the other units in a small line under it. A unit that is spent leaves the line. At zero the figures leave, a block of the page takes their place or a word is written where they were, and an event fires; a page opened after the date shows the end at once, and nothing ever goes below zero. Units are written and accorded by the browser in the language of the page (1 day, 2 days, 1 jour, 3 Tage), figures are tabular so nothing moves sideways, a screen reader meets a timer it can read as a sentence and is never interrupted, and the end is said once. One timer serves every count of the page and a count off screen draws nothing. Without JavaScript the date stays written in clear. Reduced motion respected. No library. Pattern type countdown timer, launch countdown, sale timer, shipping cut-off.

Updated

Questions

Paste the block, or give any text block the custom attribute data-countdown with the date as its value, 2026-10-30T17:00:00-04:00, and add the Embed once. The text of the block is the date written in clear, which is what the Designer canvas and a visitor without JavaScript see; the published page counts.

Yes. A date written with its offset is one instant, so every visitor counts to it whatever their own clock says. A date without offset is read on the clocks of data-countdown-zone, America/New_York for instance, summer time included, and a text marked data-countdown-local is rewritten as the date in the visitor's own time.

A countdown that subtracts one from a number every setInterval drifts, because browsers slow timers in hidden tabs and stop them when a laptop sleeps. This one counts nothing: at every look it reads the clock and subtracts it from the date, so a tab that comes back shows the right figures at once, with nothing catching up digit by digit.

A block marked data-countdown-after takes the place of the one marked data-countdown-before, or data-countdown-done="Closed" writes a word where the figures were, and the event countdown:done fires. A page opened after the date shows that end at once, and the figures never go below zero.

Not with this one, on purpose: a deadline kept in the browser starts again in a private window, and showing a false deadline to press a sale is a banned commercial practice in the European Union and the United Kingdom. A time that really comes back is written 17:00 or Fri 17:00 with data-countdown-zone, and a deadline of the visitor's own comes from your server, in the attribute or through set().