Commerce Credit Card
Credit card form with a live animated card preview that flips when the CVC field is focused.
Choose the primitives library your project already uses. Both look the same: your theme, not the variant, controls colors, shape, type and motion.
About this block
What it's for
- Credit card form with a live animated card preview that flips when the CVC field is focused.
- Payment form with card brand detection, Luhn validation and expiry formatting.
- Checkout card input that formats the number and validates expiry and security code.
For a full checkout with cart, address and shipping, use Billing Checkout Flow. For selling gift cards, use Commerce Gift Card. For changing the plan or subscription, use Billing Plan Comparison.
Includes
- Credit card form
- Card preview
- Brand detection
- Luhn validation
- Expiry formatting
- Cvc validation
- Card flip
- Masked receipt
Works with
- Radix UI and Base UI primitives (pick the one your project uses)
- React 19 and Tailwind CSS 4 in Next.js (App Router), Vite, React Router or TanStack Start, installed with the agentic-ui or shadcn CLI
- Your theme tokens, in light and dark mode
Install
Included with Agentic UI Kit (one-time license). Install needs your license key: see pricing · connect your project.
agentic-ui add commerce-credit-cardnpx shadcn@4.17.0 add @agentic-ui/commerce-credit-cardUsed in
A standalone component: drop it into any screen.
- Type
- Block
- Variants
- Radix UI and Base UI
- Themes
- Light and dark
- Widths
- Preview it at desktop, tablet and mobile widths above.
- npm packages
lucide-react- Registry dependencies
lib-primitives- Files
4 files
- components/agentic-ui/commerce-credit-card/commerce-credit-card/commerce-credit-card.tsx
- components/agentic-ui/commerce-credit-card/commerce-credit-card/card-model.ts
- components/agentic-ui/commerce-credit-card/commerce-credit-card/card-preview.tsx
- components/agentic-ui/commerce-credit-card/commerce-credit-card/card-fields.tsx
Related components
Commerce Gift Card
Interface for buying and customizing digital gift cards with a dynamic preview and scheduled delivery.
Details and live previewCommerce Inventory Alerts
Inventory alerts panel for a retail warehouse with a reorder point per SKU and a demand forecast.
Details and live previewCommerce Loyalty Points
Rewards page of an online store with a points balance, coupon redemption and Bronze/Silver/Gold/Platinum tiers.
Details and live previewCommerce Variant Picker
Variant picker for technical apparel and footwear with a color, size and fabric matrix.
Details and live preview