Skip to content
Sign upGet access
MicrointeractionsCard flip formMenu

Card flip form (Pro)

ProIncluded in $99

A card form where the card changes material and turns over for the code.

ProFrom the first digit the card wipes into its network's material with a sheen, digits stamp in, and focusing the code turns it over.

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

$ pnpm dlx shadcn@latest add @chatcn-pro/card-flip-form

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

tsx
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

PropTypeNotes
value / onValueChange{ number, expiry, cvc }Optional control
field / onFieldChange"number" | "expiry" | "cvc" | nullDrives the card without moving focus
submitLabelReactNode
onSubmit(value) => voidOnly when complete
issuerstringPrinted 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.