1.1.0 • Published 1 year ago

react-pokercards v1.1.0

Weekly downloads
3
License
MIT
Repository
github
Last release
1 year ago

react-pokercards

React Component to display Poker Cards in your React Application

Poker Canvas

I used the Poker Canvas Library from Tairraos/Poker.JS

Installation

$ npm install react-pokercards
$ yarn add react-pokercards

Usage

import PokerCard from 'react-pokercards';

Display the Ace of Spades

<PokerCard short={'As'}/>
//or
<PokerCard point={'A'} suit={'s'}/>

Display the Ten of Diamonds

<PokerCard short={'Td'}/>
//or
<PokerCard point={'T'} suit={'d'}/>

Display just the backside

<PokerCard isBackwards={true} short={'2c'}/>
//or
<PokerCard isBackwards={true}/>

defaultProps

PokerCard.defaultProps = {
    style: {},
    className: '',
    alt: '',
    size: 120,
    isBackwards: false,
    foregroundColor: '#BB5555',
    backgroundColor: '#AA2222',
    short: undefined,
    suit: undefined,
    point: undefined,
};

License

MIT