Skip to content

Liquid metal card

A metallic debit card with a reflective surface.

HDFC BANK

Debit

4400 3534 2434 6521

Sahil Barak

Valid thru

09/31

Click to flip

Installation

  1. 1

    Install the packages

    pnpm add framer-motion lucide-react clsx tailwind-merge
  2. 2

    Add the utility file

    lib/utils.ts
    import { clsx, type ClassValue } from "clsx";import { twMerge } from "tailwind-merge";
    export function cn(...inputs: ClassValue[]) {  return twMerge(clsx(inputs));}
  3. 3

    Copy and paste the code into your project

    Loading source…
  4. 4

    Update the import paths to match your project

    Point @/lib/utils to your utility file if your path aliases differ.

Usage

app/page.tsx
import { LiquidMetalIDCard } from "@/components/ui/liquid-metal-id-card";
export default function Page() {  return <LiquidMetalIDCard />;}

Props

PropTypeDefaultDescription
namestringDefault: "Sahil Barak"Cardholder name shown on both sides.
cardTypestringDefault: "Debit"Card type label.
cardNumberstringDefault: "1234 5678 9012 3456"Number shown on the front. Its last four characters appear on the back.
expirystringDefault: "09/29"Expiry text shown on the front.
classNamestringDefault: -Extra classes merged onto the root element.
styleReact.CSSPropertiesDefault: -Inline styles applied to the root element.

Move your pointer over the card to tilt it and shift the reflections. Click or tap to flip it with a soft whoosh. You can also focus it and press Enter or Space.

Credits and license

Most components here are recreations of great work from around the web. I don't claim to be the original creator - this is my attempt to reverse-engineer, replicate, and often add a few extra features. I've tried to credit everyone; if I missed someone, let me know.

  • Free to use and modify in both personal and commercial projects.
  • Attribution to Mox UI is appreciated when using a component.
  • Please don't resell the components as your own kit.
Contact Mox UI