- Components24
- Autocomplete
- Location Input
- Signature Input
- Signature Pad
- Credit Card
- Masked Input
- Color Picker
- Tag / Token Input
- Emoji Picker
- Transfer List
- Tree Select
- Image Upload / Dropzone
- Cron Expression Builder
- Inline Editable Field
- Sortable List Input
- Schedule / Availability Picker
- Phone Input
- Datetime Picker
- Smart Datetime Input
- File Upload
- Tags Input
- Multi Select
- Password Input
- Rating
Credit Card
Interactive credit-card form with visual card preview and validations.
Credit Card
Interactive credit-card form with visual card preview and validations.
Preview
•••• •••• •••• ••••
Card Holder
YOUR NAME
Expires
MM/YY
CVC
•••
This card is protected by advanced security features
Features
- Card number formatting and type detection.
- Animated card preview with front/back transitions.
- Validation hooks for expiry and CVV.
Installation
npx shadcn@latest add https://www.shadcn-form.com/r/credit-card.json
The CLI installs every dependency listed in the registry item.
Usage
import * as React from 'react'import { CreditCard } from '@/components/ui/credit-card'const [creditCard, setCreditCard] = React.useState({cardholderName: '',cardNumber: '',expiryMonth: '',expiryYear: '',cvv: '',})<CreditCard value={creditCard} onChange={setCreditCard} />