Card flip form (Pro)
ProIncluded in $99A card form where the card changes material and turns over for the code.
On this page
From the first digit the blank frosted card knows its network and changes material in a diagonal wipe with a specular sheen riding the edge: brushed graphite, green or terracotta, for invented networks with no real marks. Each digit stamps into the plastic as you type. Focusing the security code turns the card over to a ringed code box on the back, and the pay button wakes once every field is complete.
Installation
Needs chatcn Pro
This command works with a Pro license, along with every Pro component.
Or start free: sign up and get three Pro components on us, with a new one every month.
Usage
import { CardFlipForm } from "@/components/ui/chatcn/pro/card-flip-form"
<CardFlipForm submitLabel="Pay $20.00" onSubmit={(card) => tokenize(card)} />The networks are placeholders keyed by the first digit; map them to your own finishes. Never send raw card numbers to your server: hand them to your payment provider's tokenizer.
Props
| Prop | Type | Notes |
|---|---|---|
value / onValueChange | { number, expiry, cvc } | Optional control |
field / onFieldChange | "number" | "expiry" | "cvc" | null | Drives the card without moving focus |
submitLabel | ReactNode | |
onSubmit | (value) => void | Only when complete |
issuer | string | Printed on the card |
Accessibility
- Real inputs with card autocomplete and labels; the card is decoration and hidden from assistive tech.
Motion
- The wipe takes 760 ms, the flip 820 ms with a small overshoot. Reduced motion: the finish and side swap at once.