Description
react-credit-cards is a React component that draws a credit card on the screen and fills it in as a customer types into a payment form. You pass the name, number, expiry date and CVC, plus the focused field, and the card shows each value as it changes. It recognises the card issuers supported by the Payment library and also Hipercard, a Brazilian card. An acceptedCards list limits which issuers are allowed, and a callback reports the detected issuer and whether the number is valid. A preview mode shows scrambled digits such as a masked number, and an issuer prop picks the design. Wording on the card can be changed through the locale and placeholders props. Styling is controlled with SCSS variables for card width, ratio and fonts, and the package also ships compiled CSS. The source is on GitHub under the amaroteam organisation, with a demo linked from the README.…
Highlights
- Live card preview as the payment form is filled in
- Recognises major card issuers plus Hipercard
- Limit the accepted cards with a list
- Callback reports issuer and validity
- SCSS variables for size, ratio and fonts
Ratings & Reviews
No ratings yet
Be the first to rate react-credit-cards.
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
react-credit-cards FAQ
What is react-credit-cards?
A React component that draws a credit card and fills it in from the values of a payment form, so the customer sees what they typed.
How do I install it?
Add the react-credit-cards package to your React project and import its styles, either the SCSS file or the compiled CSS file.
Which card types does it support?
The issuers supported by the Payment library, plus Hipercard. You can limit the list with the acceptedCards prop.
Can I change the text on the card?
Yes. The locale prop changes wording such as valid thru, and placeholders sets the placeholder text for the fields.
Can it show card data without a form?
Yes. Preview mode shows masked digits, and the issuer prop sets which card design is shown.
What are the best react-credit-cards alternatives?
Popular alternatives to react-credit-cards include react-credit-cards-2, react-payment-inputs and react-svg-credit-card-payment-icons. See all react-credit-cards alternatives














