A React library of Card components and basic functionality.
npm install --save @theresamclaird/cards
import { Card, Back } from '@theresamclaird/cards';
<Card color="#000" suit="spades" label="A" pip="♠" value={1} />;
<Back />;
import { getDeck } from '@theresamclaird/cards';
const deck = getDeck();
import { getShoe } from '@theresamclaird/cards';
const shoe = getShoe(6); // Pass the number of decks needed for the shoe.
import { getDeck, shuffle } from '@theresamclaird/cards';
const deck = getDeck();
const shuffledCards = shuffle(deck);
const cutCards = cut(shuffledCards);
To run Storybook and see rendered Card components, run:
This runs Storybook.
Open http://localhost:6006 to view it in your browser.