GithubHelp home page GithubHelp logo

medipass / react-creditcard Goto Github PK

View Code? Open in Web Editor NEW
34.0 13.0 5.0 127 KB

๐Ÿ’ณ An awesome react credit card component.

License: MIT License

JavaScript 46.35% CSS 53.65%
react credit card shit hot awesome medipass jxom payment cool

react-creditcard's Introduction

react-creditcard

An awesome credit card component (and doesn't even use CoffeeScript!).

Motivation

Most of the card modules I've seen use CoffeeScript (and tbh I can't be bothered learning CoffeeScript to make a pull request), and some of them are not being actively maintained anymore. So I decided to port a combination of jessepollak's card and JohnyDays's react-credit-card.

Installation

yarn add react-creditcard

or

npm install react-creditcard --save

Usage

import CreditCard from 'react-creditcard';

<CreditCard
  number="4111111111111111"
  cvc="123"
  expiry="1220"
  focused="cvc"
  backDescriptionText="Use of this card is governed by the conditions of use. You must not disclose your PIN to anyone."
  />

Available Props

PropTypeDefault valueDescription
number string (optional)null Card number - spaces are not needed.
cvc string (optional)null Card security code
name string (optional)null Full name of card holder.
expiry string (optional)null Expiry of card - '/' is not needed. (e.g. '1220').
focused string (optional)null Focused field. (Available: 'name', 'cvc', 'expiry', 'number', null)
namePlaceholder string (optional)'FULL NAME' Placeholder for card holder name.
expiryBeforeText string (optional)'month/year' The text displayed above the expiry date.
expiryAfterText string (optional)'valid thru' The text displayed left of the expiry date.
backDescriptionText string (optional)null The text displayed on the back of the card.
type string (optional)null Available in case you need to explicitly specify the card type. In most cases this will be inferred for you as the user fills the form, so you won't need to use it. (Available: 'discover', 'mastercard', 'visa', 'amex')

License

MIT ยฉ Jake Moxey

react-creditcard's People

Contributors

jxom avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.