Platform
VaultVault
  • Free15
  • Navigation19
  • Buttons9
  • Scroll55
  • Text27
  • Sliders & marquees19
  • Gallery & images67
  • Cursor24
  • Page transitions10
  • Loaders2
  • Backgrounds10
  • UI components33
ButtonsPart of ProButtons
IconsPart of ProIcons
  • Interface Essentials144
  • Social Icons69
  • Payment Badges41
SavedPart of ProSaved
Support
DocumentationDocumentation
MCP serverMCP server
SettingsSettings
VaultUI componentsRolling Price Toggle
Pill Gauge StepperBrowse all 182Reading Progress Ring
  • Free15
  • Navigation19
  • Buttons9
  • Scroll55
  • Text27
  • Sliders & marquees19
  • Gallery & images67
  • Cursor24
  • Page transitions10
  • Loaders2
  • Backgrounds10
  • UI components33
  • Interface Essentials144
  • Social Icons69
  • Payment Badges41
Sign inSign in

Start free. The code for 15 components, no card needed.

Get 15 free

Rolling Price Toggle

This one is locked. Become a member to open the code for it and the rest of the Vault.

See plansTry the 15 free ones

What you'll need.

Install

  • gsap
  • CustomEase

Setup

npm i gsapregisterPlugin(CustomEase)

More like this

  • Card
  • Counter

Features.

  • A Monthly / Yearly switch whose knob slides across with a quick smear from its trailing edge
  • Every price rolls to its new number digit by digit, starting from the right, each column a beat after the last
  • When a price gains a digit a new column opens from nothing on the left, and when it loses one the column closes, so the currency and period glide along
  • A "Two months free" chip pops in beside the switch for yearly and shrinks away for monthly
  • The "/mo" label slides to "/yr" with the prices
  • Flip it again mid-roll and it carries on from wherever each digit is
  • Plan names carry a slow gradient shimmer, each a third of a cycle apart, in their own tint
  • The switch is a real role="switch", and each card has a screen-reader line such as "£42 per month"
  • Fires prt:change with the new period on every flip
  • Cards stack on phones with the chip under the switch
  • Respects prefers-reduced-motion: flips are instant and the shimmer stops
  • GSAP with CustomEase; the shimmer is CSS

How to get it right.

Use whole numbers

Prices are rolled one digit at a time, so data-prt-monthly and data-prt-yearly take whole numbers. Round to the pound (or dollar) for the headline price and put the pence in the small print.

Let the yearly price gain a digit

The column opening on the left (42 → 419) is the most satisfying part. If every price stays the same length the roll still works, it just never opens or closes a column.

Keep the chip honest

"Two months free" should match the numbers: 42 × 10 = 420, close to 419. Change the chip text when you change the prices.

Adding features, a button or a badge

Cards ship with a name and a price. After the price, add a <ul class="prt_features"> of .prt_feature items and an <a class="prt_cta">. To lift a plan, add prt_card--featured to the card, prt_cta--featured to its link and a <span class="prt_badge"> inside it. In React, pass features, cta, href and badge on a plan.

Set the screen-reader words

data-au-currency, data-au-per-month and data-au-per-year build the line each card announces. Change them with your currency and language.

Variations.

  • Default — starts on monthly, 0.6s rolls
  • Yearly first — data-au-period="yearly" to lead with the yearly prices and the chip showing
  • Slow roll — data-au-roll="1.2": a longer, more mechanical count
  • Two plans — remove a card; the grid centres what's left
  • Your colours — override --prt-card, --prt-accent, --prt-knob and the shimmer pairs on .prt_pricing

Where it fits.

  • Pricing pages — the classic three-plan layout the demo shows
  • Membership or subscription sign-up — one switch, a few tiers
  • Product pages — a single card with the switch above it

Frequently asked.

Yes. Set data-au-currency: the script writes it into each [data-prt-currency] sign and the screen-reader line. The currency sits before the number; move the span after the digits if your currency goes after.

Not as it stands. The switch has two positions and each card holds two prices.

If you add buttons, listen for prt:change on the root (detail.period is monthly or yearly) and update the links, or read the root's is-yearly class when one is clicked.

It's one CSS animation of background-position per plan name, with no script.

Each [data-au-pricing-toggle] is its own instance with its own switch.

Related components.

Pro

Image Slide Tabs

Click

Pro

Glow Band Sheet Modal

Click

Pro

Expanding Card Modal

Click