StealThis .dev

Upsell — Trial countdown banner

A self-contained top-of-app upsell banner for the fictional Northwind SaaS, art-directed in a neutral product-UI palette with Inter type and soft shadows. It announces how long the Pro trial has left with a live-ish countdown that ticks from a fixed end timestamp, a usage progress bar, an Add billing call to action and a dismiss control. When the window runs out the banner flips to a red Trial ended variant, dismiss collapses it smoothly, and demo buttons fast-forward the timeline. Vanilla JS, aria-live polite, keyboard and Esc friendly.

Open in Lab
html css vanilla-js
Targets: JS HTML

Code

Trial countdown banner

A sticky top-of-app banner for Northwind, a fictional SaaS, sitting above a lightly mocked dashboard so you can see it in context. It leads with “Your Pro trial ends in N days” beside a pill that shows the remaining time, a one-line nudge to add billing, and a gradient progress bar that fills as the trial elapses with a Day X of 14 label. On the right are a brand-coloured Add billing CTA and a circular dismiss X. The whole region is aria-live="polite", the progress track carries role="progressbar" with live aria-valuenow, and every control is keyboard operable with focus-visible rings.

The countdown is genuinely live: it runs off a fixed fictional start/end timestamp (~2 days remaining by default) and re-renders each second, surfacing days and hours normally and switching to minutes-and-seconds in the final stretch. When the clock crosses the end time the banner repaints into a red Trial ended variant — new copy, a full red progress bar and a paused plan badge below. The dismiss button (and the Esc key) collapses the banner with a smooth height-and-fade transition and raises a confirming toast.

Three demo buttons let you exercise the states without waiting: Reset restores the ~2-day window, Ends soon fast-forwards to 25 minutes left, and Force expired jumps straight to the red state. The layout is responsive down to ~360px — the actions go full width and the icon hides — and a prefers-reduced-motion guard quiets the transitions. Vanilla JS only, no frameworks or build step, and no network requests beyond the single Google Fonts link.

Illustrative UI only — Northwind, its Pro trial and all data are fictional.