Vibary.ai
← Vibe Coding

Payment Card Flip

A saved card turns on its vertical axis to put the security code where it actually lives.

commercepremiumelegantinteraction · finite · intermediate · ~0.5s
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.

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

/**
 * Vibary · Payment Card Flip
 *
 * A saved card turns on its vertical axis to put the security code
 * where it lives in the real world — on the back — and turns straight

About this pattern

Asking for a security code in a plain field makes the shopper picture the card and translate. Turning the card instead removes the translation: the sheet rotates about its vertical axis under a real perspective, the back arrives with its stripe and the code field beside it, and turning back returns the summary. Both faces are painted on one sheet with backface visibility off, so nothing ever shows through. Reduced motion keeps both faces and the control and swaps them with a crossfade — the code still gets asked for, just without the rotation.

Security code entry at checkoutSaved card in a wallet screenCard details review before payingBilling settings card management

Where it shows up

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

  • BillingLast 30 days
    Invoice 4821$169.65Paid
    Invoice 4809$412.00Paid
    Invoice 4794$88.20Due Jun 30
    Invoice 4780$1,204.00Paid
    Billing page

    A stored card turns over to reveal the number and details on its reverse.

Related patterns