Command Palette

Search for a command to run...

Docs
Modern Card Input

Modern Card Input

A sophisticated credit card input with real-time validation and card type detection

Loading...

Installation

Props

PropTypeDefaultDescription
labelstring"Card Information"The label for the card input
showPreviewbooleantrueShow card type preview
onChange(data: {number: string; expiry: string; cvc: string}) => voidundefinedCallback when card data changes

Features

  • Real-time Validation: Validates card numbers, expiry dates, and CVC codes as you type
  • Card Type Detection: Automatically detects and displays card brand (Visa, Mastercard, etc.)
  • Visual Card Icons: Shows appropriate card brand icons
  • Input Formatting: Automatically formats card numbers with proper spacing
  • Focus Management: Smooth focus transitions between fields
  • Responsive Design: Adapts to different screen sizes