Vibary.ai
← Vibe Coding

Quantity Adjust

The count rolls in the direction it moved and the order total takes a brief tint.

formsfriendlyenergeticinteraction · finite · intermediate · ~0.8s
Interactive · click to play
Variant

The animated component in this preview is rendered from the canonical file shown here. The surrounding demo shell only provides context and is not part of the copied code.

389 lines · react + motion only
import { useState } from "react";
import { AnimatePresence, motion, useReducedMotion } from "motion/react";

/**
 * Vibary · Quantity Adjust
 *
 * Changing how many of something is in the basket. The count rolls in
 * the direction it moved, the line total rolls with it, and the order

About this pattern

Changing how many of something is in a basket, with the consequence made visible. The count rolls the way it went — up for more, down for fewer — the line amount rolls with it, and the order total further down the panel picks up a short tint so the number that actually matters is not missed. Figures are text: they translate inside a fixed box and never scale, because a count that pops larger on every tap is the cheapest tell in commerce UI. Nothing springs, since a total that overshoots shows a wrong number, however briefly.

Change quantity in a basketStepper on a line itemSeat or licence countOrder total updating

Where it shows up

Screens we drew to show where this motion usually sits. Illustrations, not captures of any product.

  • Your bag
    Ridgeline GT — Bone, US 9−1+$132.00
    Merino crew sock, 2-pack−2+$24.00
    Subtotal$156.00Shipping$0.00Tax$13.65Total$169.65
    Checkout
    Cart

    Adjusting a line quantity updates the summary total in the same beat.

Related patterns