React Credit Card Number Formatter

JSON →
library 0.9.1 ·javascript
verified Jun 4, 2026

A React adapter component for formatting, validating, and managing credit card form inputs. Current stable version is 0.9.1, released under MIT license. It formats card numbers with spaces every four digits, performs Luhn validation, blocks invalid input for MM/YY/CVV fields, and uses a render-prop pattern to be styling-agnostic. Unlike alternatives (e.g., react-credit-cards), it separates formatting logic from UI and provides detailed credit card info (brand, completeness per field). Depends on React only.