Payments are encrypted.
Try the test number 4242 4242 4242 4242 with any future date.
Installation
$ pnpm dlx shadcn@latest add @synccn/card-inputFirst time in this project? Connect synccn with one command.
Usage
import { CardInput } from "@/components/ui/card-input";<CardInput onChange={({ complete }) => …} />API reference
Generated from the component's TypeScript types, so it always matches the code.
CardInput
Card number, expiry and CVC in one field. Detects the brand, formats as you type, checks the number with the Luhn algorithm and moves focus forward. This is UI only: send card details to your payment provider, never your own server.
- onChange
(state: { brand?: string; complete: boolean }) => voidCalled on every change with the detected brand and whether all fields look valid.
- className
stringExtra classes for the root element.
Dependencies
Read from the component's imports when the site builds. The CLI installs all of these for you.
Helpers
- lib/utilscn (merges class names)
npm packages
- clsx for cn()
- tailwind-merge for cn()
- lucide-react for CreditCard, Lock
Accessibility
From the source
Read from this component's code when the site builds, so it can't drift.
- ARIA attributes: aria-label