SwipeUI

Credit card

Ten real-world credit cards drawn as vector art, front and back, with every printed detail editable.

npx @swipeui/cli add credit-card
Variant
Preset
Material
Scheme
Feel
Interactive web demo. Native materials, gestures and system presentation differ on device.

When to use it

  • A wallet or banking screen that shows the customer's card the way it looks in their hand, with their own number, name and dates, in one of ten real-world designs.
  • Card selection, such as choosing which card pays, where recognising the real card design matters.
  • Onboarding for a new card, showing the front and then flipping to the back with Flip card.
  • A swipeable deck of saved cards with Card stack.

When not to use it

  • Collecting card details. Use text fields with the platform's secure input; this card only displays.
  • Showing a full number or security code to anyone but the verified cardholder. Pass masked and leave securityCode empty.
  • Cards from an issuer you aren't allowed to depict. Use your own design or a plain style instead.
  • A generic payment summary. A list row with the last four digits is lighter.

Installation

Installs with a Pro licence

Everything on this page is public except the source. Founder pre-sale opens around 5 January 2027.

Usage

app/wallet.tsx
import { CreditCard } from '@/components/swipeui/card/credit-card';
import { amexPlatinum } from '@/components/swipeui/card/designs/amex-platinum';

<CreditCard
  design={amexPlatinum}
  number="3782 822463 10005"
  holder="Alex Morgan"
  expiry="08/29"
  memberSince="19"
  emblem={require('@/assets/centurion.webp')}
/>;

Examples

app/wallet.tsx
import { CreditCard } from '@/components/swipeui/card/credit-card';
import { amexPlatinum } from '@/components/swipeui/card/designs/amex-platinum';

// The back, with the number masked to its last four digits.
<CreditCard design={amexPlatinum} face="back" number={card.number} holder={card.holder} expiry={card.expiry} masked />;
app/wallet.tsx
import { CreditCard } from '@/components/swipeui/card/credit-card';
import { chaseSapphireReserve } from '@/components/swipeui/card/designs/chase-sapphire-reserve';
import { useToast } from '@/components/swipeui/ui/toast';

// Copying shows its own small "Copied!" toast. To use your app's toast instead, turn it off.
// copyable={['expiry']} lets only the expiry be copied; copyable={false} turns copying off.
const toast = useToast();

<CreditCard
  design={chaseSapphireReserve}
  face="back"
  number={card.number}
  holder={card.holder}
  expiry={card.expiry}
  copyable={['number', 'expiry']}
  copyToast={false}
  haptics={false}
  onCopy={(field) => toast.show({ title: field === 'number' ? 'Card number copied' : 'Expiry copied', tone: 'success' })}
/>;

Designs

Import one design and pass it as design. Each lives in its own file, so only the cards you use ship in your app.

DesignImportNumber printed on
American Express PlatinumamexPlatinum from designs/amex-platinumFront
American Express GoldamexGold from designs/amex-goldBack
American Express CenturionamexCenturion from designs/amex-centurionFront
Chase Sapphire ReservechaseSapphireReserve from designs/chase-sapphire-reserveBack
Capital One Venture XcapitalOneVentureX from designs/capital-one-venture-xBack
Apple CardappleCard from designs/apple-cardNot printed
Chase Freedom UnlimitedchaseFreedomUnlimited from designs/chase-freedom-unlimitedBack
Discover itdiscoverIt from designs/discover-itBack
HDFC Bank InfiniahdfcInfinia from designs/hdfc-infiniaBack
Citi Double CashcitiDoubleCash from designs/citi-double-cashBack

The American Express designs take an emblem: a dark medallion for the platinum and gold cards, and a light one for the black Centurion card, which blends it with a screen blend.

API reference

CreditCardProps

PropTypeDefaultDescription
designCreditCardDesign—

The card design, such as amexPlatinum from ./designs/amex-platinum.

face?CreditCardFace'front'

Which side to draw.

numberstring—

Card number; separators are ignored and digits are grouped by the design.

holderstring—

Cardholder name as printed.

expirystring—

Expiry as printed, such as "08/29".

memberSince?string—

Member-since year, for designs that print one.

securityCode?string—

Security code printed on the back. Display only: never log or store it.

frontCode?string—

Code printed on the front, for designs that print one there.

signature?stringthe holder's name in title case

Signature on the back.

copy?Partial<CreditCardCopy>the design's words

Replace any printed words.

palette?Partial<CreditCardPalette>the design's palette

Override any artwork colour.

fonts?Partial<CreditCardFonts>system sans, mono, serif and script

Override the system fonts used for lettering.

emblem?unionundefined

Front emblem, such as a portrait medallion: an image source (drawn engraved into the metal) or any node. Without one the design draws a plain engraved medallion.

masked?booleanfalse

Hide every digit except the last four.

sample?booleanfalse

Print the design's specimen marker.

copyable?boolean | readonly CreditCardCopyField[]true

Which printed details a long press copies: true for the number and expiry, false for neither, or a list such as ['expiry']. A masked number can't be copied, and the security code never is.

onCopy?((field: CreditCardCopyField, value: string) => void)—

Called after a copy with the field and the text copied (the number without separators).

onCopyError?((error: unknown) => void)—

Called when the clipboard refuses the text.

copyToast?booleantrue

Show the small toast on the card after a copy. Turn it off to show your own from onCopy.

clipboardLabels?Partial<CreditCardClipboardLabels>CLIPBOARD_LABELS

Replace the words used when copying.

haptics?booleantrue

Haptic feedback when a copy succeeds or fails.

motion?MotionOverride—

Motion for the toast.

accessibilityLabel?stringthe design, last four digits, holder and expiry

What a screen reader announces.

className?string—

Classes merged over the card container.

style?StyleProp<ViewStyle>—

Native style escape hatch for the card container.

testID?string—

Root identifier.

Composition and behavior

  • design picks a real-world card. Fronts follow each issuer's published card art; backs follow the network's standard layout.
  • Every printed detail is a prop: number, holder, expiry, memberSince, frontCode, securityCode and signature, plus copy for every printed word, including the issuer line on the back.
  • The number is grouped the way the design prints it (4-6-5 or 4-4-4-4). masked hides every digit except the last four, and the security code.
  • emblem takes an image source, drawn engraved into the metal, or any node. The item ships no images; pass your own licensed artwork.
  • palette and fonts override the design's colours and the system fonts used for lettering.
  • Long-press the printed number or expiry to copy it. A small "Copied!" toast appears on the card with a success haptic. The number is copied as digits only. Copying works on whichever side prints the details; a masked number can't be copied and the security code never is. See Copy settings below to switch each part.
  • A short tap is never taken by the card, so it still reaches a flip card, a stack or a pressable row around it. Screen readers get Copy card number and Copy expiry date actions on the card instead of the long press.
  • The card fills its container's width at real card proportions. Use Flip card to turn it over and Card stack to swipe through several.
  • It's display only. Never log or store the security code, or the values onCopy receives.

Copy settings

Every part of copying is a prop, so you choose per card what can be copied and how it's confirmed.

PropDoesDefault
copyabletrue copies the number and expiry, false neither, or list the ones you want: ['number'] or ['expiry']true
copyToastShows the built-in "Copied!" toast; turn it off to show your own from onCopytrue
hapticsPlays the success or failure buzztrue
clipboardLabelsReplaces the toast text, the screen-reader actions and what's announcedEnglish
onCopy / onCopyErrorTell you what was copied ('number' or 'expiry' and the text) or why the copy failednone

Behavior and gestures

  • Long-press the printed card number or expiry to copy it. A small "Copied!" toast appears on the card, with a success haptic. The number is copied as digits only, without spaces.
  • A short tap is never taken: it reaches whatever wraps the card, so the card can sit inside a flip card, a stack or a pressable row of your own.
  • A masked number can't be copied, and the security code never is. copyable chooses what copies: true for the number and expiry (the default), false for neither, or a list such as ['expiry']. copyToast={false} hides the built-in toast so you can show your own from onCopy, and haptics={false} turns the buzz off.
  • face chooses the side. Pair two cards in Flip card for a 3D turn.
  • Every printed detail comes from props: number, holder, expiry, member-since year, front code, security code, signature and all printed words. masked hides the number and the security code.

Accessibility

  • The card is one image element, announced as the design, the last four digits, the holder and the expiry, for example "American Express Platinum card ending in 0005, ALEX MORGAN, valid thru 08/29".
  • The back is announced as the card's back and never reads the security code aloud.
  • VoiceOver and TalkBack users get "Copy card number" and "Copy expiry date" as actions on the card, on whichever side prints them; the copy is announced. All words can be replaced with clipboardLabels.
  • Card lettering is drawn at physical scale and doesn't grow with Dynamic Type; the spoken label carries the details.
  • Pass accessibilityLabel to describe a custom design or to add context such as "Default card".

Motion

  • Uses the overlay motion role, so it follows your app's feel. Pass motion to tune this one instance.
  • The "Copied!" toast fades in and out on the overlay role; under Reduce Motion it uses the short reduced fade.
  • The artwork itself is static. Flip card and Card stack add motion around it.

Performance

  • Each face is two SVG layers. The engraved art is static path data; grain and barcodes are generated once per card and memoised.
  • An image emblem is one bitmap; pass one sized for about three times the card's on-screen width.

Notes for AI

  • Import one design from ./designs and pass it as design: amexPlatinum, amexGold, amexCenturion, chaseSapphireReserve, capitalOneVentureX, appleCard, chaseFreedomUnlimited, discoverIt, hdfcInfinia or citiDoubleCash. The core never imports designs, so unused ones stay out of the bundle.
  • Pass the number as a string; separators are ignored and the design groups the digits. Set masked to show only the last four.
  • Never log, persist or send securityCode; it's for display to the verified cardholder only.
  • Copying is on by default; copyable={['number']} or ['expiry'] limits it to one detail and copyable={false} turns it off. onCopy(field, value) reports 'number' or 'expiry'; never log or send the value. Custom designs mark where they print the details with copyTargets (boxes in 856 × 540 card units); standardBackTargets(signaturePanel) gives the boxes for StandardBack.
  • emblem takes an image source (drawn engraved into the metal with a multiply blend) or any node; the item ships no images.
  • Designs that print the number on the back (Gold, Sapphire Reserve, Venture X, Freedom Unlimited, Discover it, Infinia, Double Cash) show it with face="back"; Apple Card prints no number at all.
  • Dark designs such as amexCenturion draw the emblem with a screen blend, so pass a light-on-dark medallion there.

Compatibility

Runs onSupported
Expo SDK 57Yes
Expo SDK 58Yes
React Native CLI (with Expo modules)Yes
Expo GoYes
iOSYes
AndroidYes

This table describes API support and static bundle checks. Native runtime, device accessibility and bare Uniwind compatibility remain pending.

Related items