Description
react-credit-cards-2 is a community fork of the react-credit-cards package. It is a React component that draws a credit card and fills it in as a payment form is completed. The fork was made to update dependencies, to work with React 17 and React 18, and to clear installation warnings. You pass the name, number, expiry, CVC and focused field as props, and the card displays them as they change. A preview mode shows scrambled data, such as a masked number, and an issuer prop sets the card design in that mode. The issuer list covers the card issuers supported by the credit-card-type library, plus Dankort, Laser and Visa Electron. An acceptedCards prop limits which cards are allowed, and a callback reports the card type and whether the number is valid. Styling comes as SCSS or compiled CSS, and the README links to a CodeSandbox demo.…
Highlights
- Community fork of react-credit-cards
- Works with React 17 and React 18
- Live card preview as the form is filled in
- Issuers from credit-card-type plus Dankort, Laser and Visa Electron
- Limit accepted cards with a list
Ratings & Reviews
No ratings yet
Be the first to rate react-credit-cards-2.
People also visit

react-payment-inputs
A React Hook & Container to help with payment card input fields
react-svg-credit-card-payment-icons
React components library with 6 styles, 108 icons, TypeScript support
react-payment-inputs
A zero-dependency React Hook & Container to help with payment card input fields
react-payment-logos
React components library to display logos of major payment brands and methods

@schematichq/schematic-icons
React component library for Schematic's icon system with TypeScript support
react-credit-cards-2 FAQ
How is it different from react-credit-cards?
It is a hard fork that updates dependencies, supports React 17 and 18, and clears installation warnings.
How do I install it?
Install react-credit-cards-2 and import its styles, either the SCSS file or the compiled CSS file.
Which card types does it support?
The issuers supported by credit-card-type, plus Dankort, Laser and Visa Electron.
Is there a demo?
Yes. The README links to a CodeSandbox demo.
What are the best react-credit-cards-2 alternatives?
Popular alternatives to react-credit-cards-2 include react-credit-cards, react-payment-inputs and react-svg-credit-card-payment-icons. See all react-credit-cards-2 alternatives














