react-pokercards
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

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

Package Sidebar

Install

npm i react-pokercards

Weekly Downloads

9

Version

1.1.0

License

MIT

Unpacked Size

42.2 kB

Total Files

6

Last publish

Collaborators

  • johnnythetank