Vibary.ai
← Vibe Coding

Gift Card Apply

A single sheen crosses the card while the balance eases down and the amount due settles to zero.

commerceelegantfriendlyinteraction · finite · intermediate · ~0.9s
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.

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

/**
 * Vibary · Gift Card Apply
 *
 * Applying a gift code sends a single sheen across the card and eases
 * the balance down to what is left, while the amount due settles to

About this pattern

Redeeming a stored balance at checkout. The sheen is a receipt for the tap rather than decoration, so it makes exactly one pass and never loops. The figures ease rather than spring: an amount of money that overshoots shows a value the customer was never charged, however briefly, so the balance and the amount due are tweened with tabular figures that keep their width, weight and baseline the whole way. The credit row opens beneath the order total as the count runs, which is what ties the two numbers together.

Gift card redemptionStore credit at checkoutVoucher balance appliedWallet top-up spend

Where it shows up

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

  • Payment
    Card number4242 4242 4242 4242Name on cardN. Bergström
    Expiry04 / 28CVC•••
    Subtotal$156.00Shipping$0.00Tax$13.65Total$169.65
    Pay $169.65
    Checkout

    Redeeming a card animates the stored balance down to its new value on the card face.

Related patterns