Chánh Đại

Payment Card

Component

About

Credit or debit card at ISO size, with embossed text and a flippable back. From chanhdai.com (ncdai), MIT.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Payment Card to your project and fits it to your theme.

Code

How Payment Card is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

import { PaymentCard, PaymentCardBrand, PaymentCardChip, PaymentCardContactless, PaymentCardExpiry, PaymentCardFront, PaymentCardIssuer, PaymentCardName, PaymentCardNumber } from "@/components/ui/chanhdai-payment-card"

// ---- inlined from src/components/chanhdai-mark.tsx ----
export function ChanhDaiMark(props: React.ComponentProps<"svg">) {
  return (
    <svg
      xmlns="http://www.w3.org/2000/svg"
      fill="none"
      viewBox="0 0 512 256"
      aria-hidden
      {...props}
    >
      <path
        fill="currentColor"
        d="M192 256H64v-64h128v64ZM448 64H320v128h128v64H256V0h192v64ZM64 192H0V64h64v128ZM512 192h-64V64h64v128ZM192 64H64V0h128v64Z"
      />
    </svg>
  )
}

export function getMarkSVG() {
  return `<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 256 128"><path fill="currentColor" d="M96 128H32V96h64v32ZM224 32h-64v64h64v32h-96V0h96v32ZM32 96H0V32h32v64ZM256 96h-32V32h32v64ZM96 32H32V0h64v32Z"/></svg>`
}

export default function PaymentCardSavedDemo() {
  return (
    <ul role="list" className="flex flex-col gap-4">
      <li>
        <PaymentCard className="w-72">
          <PaymentCardFront className="bg-primary text-primary-foreground">
            <PaymentCardIssuer>
              <ChanhDaiMark />
            </PaymentCardIssuer>
            <PaymentCardChip />
            <PaymentCardContactless />
            <PaymentCardNumber value="4242 4242 4242 4242" masked />
            <PaymentCardExpiry>12/30</PaymentCardExpiry>
            <PaymentCardName>NGUYEN CHANH DAI</PaymentCardName>
            <PaymentCardBrand brand="visa" />
          </PaymentCardFront>
        </PaymentCard>
      </li>

      <li>
        <PaymentCard className="w-72">
          <PaymentCardFront>
            <PaymentCardIssuer>
              <ChanhDaiMark />
            </PaymentCardIssuer>
            <PaymentCardChip />
            <PaymentCardContactless />
            <PaymentCardNumber value="5555 5555 5555 4444" masked />
            <PaymentCardExpiry>09/29</PaymentCardExpiry>
            <PaymentCardName>NGUYEN CHANH DAI</PaymentCardName>
            <PaymentCardBrand brand="mastercard" />
          </PaymentCardFront>
        </PaymentCard>
      </li>
    </ul>
  )
}

Dependencies

More by Chánh Đại

View all
  • Apple Hello Effect

    Apple Hello Effect

    692
  • Theme Switcher

    Theme Switcher

    363
  • Hero Golden Spiral

    Hero Golden Spiral

    121
  • Mobius Loop Icon

    Mobius Loop Icon

    90
  • Wheel Picker

    Wheel Picker

    79
  • Testimonial 2

    Testimonial 2

    50
  • Glow Card Grid

    Glow Card Grid

    49
  • Spinning Circular Text

    Spinning Circular Text

    26