Credit Card
Group card digits into blocks of four as the user types
Credit Card
The creditCard formatter groups card digits into blocks of four, separated by spaces, as the user types.
Usage
validationSchema: {
card: { format: "creditCard" },
}Result
| Typed | Result |
|---|---|
4242424242424242 | 4242 4242 4242 4242 |
Things to know
- Pair with the
creditCardvalidator (creditCard: true) for the Luhn checksum check.