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 componentsPill Gauge Stepper
Elastic Pill MenuBrowse all 182Rolling Price Toggle
  • 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

Pill Gauge Stepper

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

  • Form
  • Counter
  • Fill

Features.

  • The pill is the gauge: an orange fill slides further in with every plus and draws back with every minus, settling with a little spring
  • The − and + icons ride along at half the rate, growing with the room their half has and dimming as they near the edge
  • The quantity and the line total roll digit by digit: up for more, down for less, each column a moment after the last
  • A digit that appears (64 → 128) opens room for itself, and one that leaves closes it, so the currency sign glides along
  • Pressing past the minimum or maximum squashes the pill sideways and springs it back instead of doing nothing
  • Hold a button to repeat; it waits a beat, then speeds up the longer you hold
  • The quantity is a real spinbutton: arrows, Page Up / Page Down, Home and End; the buttons report aria-disabled at the limits and the total is announced politely
  • Fires pst:change with the quantity and line total on every change
  • Respects prefers-reduced-motion: every change is set instantly
  • GSAP with CustomEase, plain CSS for the look

How to get it right.

Keep the range short

The fill moves (max − min) steps across the pill. One to six is a clear stride per press; past twenty the steps get small and the gauge reads as a slider.

Set the screen-reader words

data-au-unit, data-au-units and data-au-currency-name are what assistive tech reads ("3 skirts", "192 pounds"). Change them with the product and currency.

Let the price drive the total

The line total is quantity × data-au-price, rounded to a whole number. For prices with pence, use a whole-number price in the smallest unit and show the currency to match, or set data-au-price="0" to hide the total and compute your own.

Adding a line under the name

It ships with just the name. Add <p class="pst_meta"> after .pst_name, or pass meta in React.

Wire it to your cart

Listen for pst:change on the root; detail.value is the quantity and detail.total the line total.

Variations.

  • Default — 1 to 6, starting at 2, £64 each
  • No total — data-au-price="0": the picker alone
  • Bigger range — data-au-max="12": smaller strides, and the hold-to-repeat earns its keep
  • Quick — data-au-duration="0.4": a snappier slide and roll
  • Your colours — override --pst-ink, --pst-surface, --pst-fg and --pst-muted on .pst_item

Where it fits.

  • Bag and basket rows — the demo's line item
  • Product pages — quantity beside the add button, without the total
  • Bookings — guests, tickets or nights, with a running price

Frequently asked.

Yes: set data-au-min="0". The fill is empty at the minimum whatever it is.

Quantities are whole numbers and the total is rounded to a whole number. Use the smallest currency unit for prices with pence.

The buttons are pointer-driven, so tap and hold work the same as a mouse. The pill keeps its size on phones; the line item stacks.

Each [data-au-pill-stepper] is its own instance with its own value. Call window.au.PillStepper.refresh() after adding rows.

From the spinbutton's aria-valuenow, or from the pst:change event.

Related components.

Pro

Image Slide Tabs

Click

Pro

Glow Band Sheet Modal

Click

Pro

Expanding Card Modal

Click