Componentdata3.49 KB gzipZero dependencies

Credit Card

Universal payment card visualizer with real-time card number formatting, brand badge detection (Visa, Mastercard, Amex), metallic EMV chip, and interactive 3D flip card to show CVV.

Preview

Live Preview
Open ↗

Installation

Tokens guide →

Add to your project via CLI (zero dependencies, code you own):

npx bigbullui add credit-card

Or install the full npm package:

npm install bigbullui

Usage

tsx3 lines
import { CreditCard } from "@/components/ui/credit-card"; <CreditCard cardNumber="4111111111111111" cardHolder="ADA BULL" expiry="12/28" />

Source code

credit-card.tsx + 1 helper

Zero third-party dependencies (2 local files shown in tabs below).

tsxcredit-card.tsx634 lines
"use client"; import * as React from "react";import { cn } from "./lib/utils"; export type CardBrand =  | "visa"  | "mastercard"  | "amex"  | "discover"  | "jcb"  | "diners"  | "generic"; export type CardVariant = "default" | "night" | "accent" | "gold" | "minimal";export type CardSize = "sm" | "md" | "lg"; export interface CreditCardProps extends React.HTMLAttributes<HTMLDivElement> {

Props

Interactive Prop Playground

Tweak parsed AST props below to generate ready-to-paste JSX.

tsx3 lines
import { detectCardBrand } from "@/components/ui/credit-card"; <detectCardBrand />
PropTypeDescription
cardNumberstring15-19 digit card number, raw or formatted
cardHolderstringCardholder name
expirystringExpiry date string, e.g. "12/28" or "1228"
cvvstring3 or 4 digit CVV/CVC security code
brandCardBrand | "auto"Card brand override. Defaults to auto-detection from cardNumber
flippedbooleanControlled flip state (true shows the back of the card)
defaultFlippedbooleanDefault flip state if uncontrolled
onFlipChange(flipped: boolean) => voidCallback triggered when card flip state changes
interactivebooleanEnables clicking or keyboard space/enter to flip card
variantCardVariantVisual style theme variant
sizeCardSizeDimension scale of the card
maskNumberbooleanMask middle digits of the card number
issuerstringBank / Issuer name printed on card
tierstringCustom ticket stub tier label, e.g. "VIP PASS"
showChipbooleanShow the metallic EMV chip graphic
showContactlessbooleanShow the contactless symbol
classNamestringCustom class names