Skip to content

Credit Card

Pro

Shows a payment card as a real card: the holder, the number, the expiry, and the network. The number stays hidden until the person asks to see it.

  • Base UI
  • Motion
  • React 19
  • Tailwind CSS 4

Added Nov 9, 2026 · Pro license

Playground

Loading the preview

Props

Needs your Pro API key in GELATIN_UI_PRO_TOKEN. Set it up

Pro itemAPI key required

Credit Card needs a Pro API key

Try the live preview for free. With Pro, the add command above puts the source in your project.

Files it adds
25
More Pro items, one API key
+327
Your coding agent runs it
1 cmd

$79$129once, for life

Already have Pro? Sign in to set up your API key.

Compose the face from parts. Pass only the last four digits when you can, and put the network mark in CreditCardNetwork.

The sample also uses Card Brand. One command adds them with this item:

virtual-card.tsx

CreditCard

<div>
PropTypeDefaultDescription
orientation"horizontal""vertical""horizontal"
size"default""lg""sm"—
variant"empty""glass""metal""midnight""outline""primary"—
tintstring—The base color under the glass finish (a data color).
revealedboolean—Show the full number and CVV (controlled). A Folder sets it for the card inside.
defaultRevealedbooleanfalse
onRevealedChange—
...props<div> attributes—Every other attribute goes to the <div>, with a ref.
  • Use it to show a card that people already have, such as a virtual card or a saved card.
  • Use CreditCardRevealToggle or revealed to show the full number and CVV.
  • Use CreditCardFlip to turn the card over to its back, and CreditCardFolder to slide it out of a sleeve.
  • Use CreditCardWallet to pick one card from a stack or a fan of cards.
  • Use variant="empty" for a card with no data yet.
  • For a small network badge in a list, use a Card Brand.
  • To pick a plan or an option from cards with text, use a Choice Card.
EnterorSpaceOn a reveal toggle: shows or hides the number and CVV. On a Flip: turns the card over.
Arrow keysIn a Wallet: picks the next or the previous card.

The card is a group named "Payment card" (change it with aria-label). Screen readers read the holder, the number, and the expiry in order.

While the number is masked, the dots are hidden from screen readers, so they hear only the last four digits.

The reveal toggle is a Base UI Toggle named "Show card details". A Flip is a Toggle named "Show card back", and the face that does not show is aria-hidden.

A Wallet is a radio group: Tab goes to the chosen card and the arrow keys pick another.

Reveal digits
popup · 150ms · ease-panel (0.2, 0.4, 0.2, 1) · each hidden digit rolls in after the one before it
Flip
sheet · 300ms · ease-panel (0.2, 0.4, 0.2, 1) · the card turns over and shrinks to 95% at 90°
Folder
sheet · 300ms · ease-panel (0.2, 0.4, 0.2, 1) · the card rises out of the sleeve
Wallet
toast · 300ms · ease-panel (0.2, 0.4, 0.2, 1) · the chosen card moves to the front
  1. AddedCredit Card.
Open the release