Payment Card
Shows a payment card as the card itself, with its name, last four digits and expiry, and tilts toward the pointer.
Configurations
7 examplesAdd to your project
One command adds this component to your project.
Run the following command. New project? Run npx shadcn@latest init first to set up Tailwind and path aliases.
npx shadcn@latest add @aicanvas/••••••••••••Light and dark both come with the install and follow the dark class on <html>, the shadcn dark mode setup (next-themes with attribute="class").
Props
Every prop this component accepts. Any other prop is forwarded to the underlying element.
| Prop | Type | Default | Description |
|---|---|---|---|
| brand | React.ReactNode | - | The issuer's name or lockup, top left, in the primary ink. None by default. |
| kind | string | - | What the card is ("Debit", "Credit", "Virtual"), top right in the meta ink. |
| label | string | - | The card's own name ("Everyday", "Travel"), over the number. |
| last4 | string | - | The last four digits; the number is shown masked as "•••• 4821". |
| expiry | string | - | The expiry ("08/29"), bottom right. |
| tone | 'graphite' | 'steel' | 'ember' | 'brand' | 'graphite' | The lacquer: graphite (neutral with a trace of brand), steel (the blue end of the ramp), ember (the system's contrast orange, pinned to its token in both themes) or brand (the deep brand lacquer). |
| interactive | boolean | true | Tilt toward a mouse pointer with a light across the face, a lit rim and one rung of lift on hover. Off under reduced motion and on touch. |
| dimmed | boolean | false | The face recedes to half strength, for a card that sits behind another. |
| raised | boolean | false | One rung up the elevation ladder, for the card on top of a stack. |
| width | number | string | - | The card's width (a number of px or a CSS length); the height follows the card ratio. Fills its container by default. |