StealThis .dev

Pricing — Monthly/annual toggle

A self-contained three-tier pricing page for the fictional Northwind Cloud, art-directed in a neutral product-UI palette with Inter type and soft shadows. Starter, Pro and Scale cards sit under a pill-shaped Monthly versus Annual segmented toggle that carries a Save 20 percent badge. Choosing a period slides the active pill, count-up animates every headline price between figures, and the per-seat billing note swaps accordingly. The choice persists via aria-pressed and localStorage, the toggle is fully keyboard operable, and a small toast confirms each switch.

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

Code

Monthly/annual toggle

A complete three-tier pricing page for Northwind Cloud, a fictional SaaS, built in the neutral product-UI palette with Inter type, hairline borders and soft shadows. A centered hero introduces the plans and hosts a pill-shaped Monthly | Annual segmented control; the Annual option wears a teal Save 20% badge. Below it sit three cards — Starter, Pro and Scale — each with a tagline, a large tabular-numeral price, a per-period label, a per-seat billing note, a CTA and a checkmarked feature list. The Pro card is lifted as the Most popular tier with a brand-coloured ribbon and a deeper glow.

Toggling the control is the core interaction. The active segment’s sliding pill animates into place, every headline price count-ups between its monthly and annual figure (with a subtle vertical swap), and the billing note flips between “billed monthly” and “billed annually”. The chosen period is reflected in each button’s aria-pressed state and persisted to localStorage, so the page reopens on the reader’s last choice. A toast confirms every switch, and the plan CTAs raise their own toast noting the selected plan and billing period.

The toggle is keyboard operable — Arrow, Home and End keys move between the two segments — and the whole page is responsive down to ~360px, where the segmented control stretches full width and the cards stack with Pro floated to the top. Focus-visible rings, hover and active states, and a prefers-reduced-motion guard round it out. Vanilla JS only, no frameworks, no build step, and no network requests beyond the single Google Fonts link.

Illustrative UI only — Northwind Cloud, its plans and prices are fictional.