PaymentMethodCard
The physical card object. 3D flip, pointer tilt.
npx shadcn add @lopifi/payment-method-cardExamples
The same component, case by case. Each stage is the shipped code with the props it shows; switch to Code for the usage.
Custom tint
The issuer’s own face color, overriding the network default; keep it dark enough for the face ink.
How it behaves
What it renders, what it refuses to render, and why. The same paragraphs as the family spec, so the two can’t disagree.
The physical object. It gets two of the four sanctioned delight moments: the flip and the tilt.
Geometry, from ISO/IEC 7810 ID-1:
aspect-ratio: 1.586 (85.60 × 53.98 mm)
border-radius: 3.7% / 5.9% (3.18mm — 3.7% of width, 5.9% of height)
Real proportions matter. A 16:9 card with a 24px radius reads as a rectangle, not a card.
Networks: Visa, Mastercard, American Express, Discover, JCB, UnionPay and Diners Club. The
mark is CardNetworkMark unless a licensed one is passed
as networkLogo.
Face: flat, a single tint, network mark top-right opposite the chip, masked PAN in tnum with ss02 (so a 0 isn't an O), holder name in label uppercase, expiry MM/YY. Each network has a dark default tint close to the color a reader expects of it, and tint overrides it with the issuer's. Visa, Amex and Diners Club print their mark in the face's ink; the others print in color. The masked number follows the network's grouping: •••• •••••• •0005 for Amex, •••• •••••• 1667 for a 14-digit Diners Club.
Amex prints its four-digit code on the front, above the number on the right. An Amex card reveals the code in place and doesn't turn over, because flipping to an empty reverse teaches the holder to look in the wrong place. The other six flip to a three-digit code on the back.
No code, no control. A card on file keeps no security code after authorization. Without cvv the reveal button isn't rendered, since a flip to ••• reveals nothing.
Motion:
- Flip to reveal CVV —
rotateY(0→180deg),spring.playful, real 3D withpreserve-3d+backface-visibility: hidden. Not a crossfade. Spec. - Pointer tilt — ±6° from pointer position via
spring.track, plus a specular sheen atopacity 0→0.12. Desktop only, gated behind@media (hover: hover) and (pointer: fine). Springs home on leave. - Reduced motion: instant swap, no tilt.
The tilt is allowed only because the card is decorative. The same effect on a KpiCard fails review.
Security: CVV and full PAN are never in the DOM until revealed, never in analytics, never in a screenshot-able state without an explicit user action.
The accounting it encodes
The concepts this component renders, each defined once in the lexicon.
More in Cards
See also
Where this component is specified, defined and running.
Elsewhere in the system
The live section PaymentMethodCard renders in, the calculators behind its figures, and the ledger payloads that feed it.
- PaymentMethodCard, runningThe cards showcase — live, with theme, density, grayscale and reduced-motion switches.
- CardsAll cards: 24px radius, 24px inset, --surface on --canvas, 1px --border, no resting shadow. Specs for 11 React components: BalanceCard, KpiCard, AccountCard, PaymentMethodCard and 7 more.
Components are copied into your repository and meant to be edited. Rounding policy, fiscal calendar and compliance copy differ per company.
Release notes
Get an email when Cards changes
Your copy doesn’t update itself when we fix something here.
- One email when a Cards component needs a migration
- Nothing when nothing changes
Or install it now