Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-credit-card-flipping

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-credit-card-flipping

Credit card flipping to ReactJS

  • 1.0.22
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

React Credit Card Flipping

Credit card flipping for ReactJS

Demo

Install

   npm install react-credit-card-flipping

ou

yarn add react-credit-card-flipping

Usage

import React, { useState } from 'react';
import Card from 'react-credit-card-flipping';

export default function App() {
  const [cardNumber, setCardNumber] = useState('');
  const [cardName, setCardName] = useState('');
  const [cardBrand, setCardBrand] = useState('');
  const [cardExpiry, setCardExpiry] = useState('');
  const [cardCVV, setCardCVV] = useState('');
  const [focusCVV, setFocusCVV] = useState(false);

  return (
    <div id="form">
      <Card
        number={cardNumber}
        name={cardName}
        expiry={cardExpiry}
        cvv={cardCVV}
        flipCard={focusCVV}
      />
      <form>
        <input
          type="tel"
          name="number"
          placeholder="Card Number"
          onChange={(event) => setCardNumber(event.target.value)}
        />
        ...
        <input
          type="tel"
          name="cvv"
          placeholder="CVV"
          onChange={(event) => setCardCVV(event.target.value)}
          onFocus={() => setFocusCVV(true)}
          onBlur={() => setFocusCVV(false)}
        />
      </form>
    </div>
  );
}

Props

propertypropTyperequireddefaultdescription
namestringyesCardholder Name
numberstring | numberyesCard number
expirystringyesCard expiry date 00/00
cvvstring | numberyesCard CVC/CVV
brandstringyesCard brand URL
backgroundColorstring-#DDDCard background color when empty
filledBackgroundColorstring-#134869Card background color when not empty
flipCardboolean-falseFlip card when there`s focus or blur on CVV input
emptyNamestring-Cardholder NameDefault value when name is empty

LICENSE

This project is licensed under the MIT License.

Development by: André Coelho

Keywords

FAQs

Package last updated on 15 May 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc