component
Playing cards
Four-color playing cards: full-size cards, mini cards, hole cards and a five-slot board.
A♥
K♦
Q♠
J♥
2♣
Installation
$ npx shadcn@latest add https://www.pokerstudy.ai/r/playing-card.jsonUsage
import { Board, HoleCards } from "@/components/pokerstudy/playing-card";
export function Hand() {
return (
<div className="flex items-center gap-4">
<HoleCards cards={["Ah", "Kd"]} />
<Board cards={["Qs", "Jh", "2c"]} />
</div>
);
}Examples
Hold'em
A♥
K♦
Omaha
A♥
K♦
Q♠
J♣
Flop
Q♠
J♥
2♣
Four suits
A♠
K♥
10♦
2♣
Mini cards
AK104
Generative UI
A model can draw this with json-render. Install generative UI and spread its definitions into your catalog. The model reads the description and the schema below, and answers with a spec like the example.
PlayingCard
One four-color playing card. A null card is an empty slot. For a hand or a board use HoleCards or Board.
A♠
HoleCards
A player's hole cards, fanned. Use whenever the answer names a specific hand.
A♥
K♦
Board
The community cards. Always five slots; streets not dealt yet show as empty.
Q♠
J♥
2♣
Props
Generated from the component source with react-docgen-typescript. Suit colors, corner radius, and the felt behind the preview follow the theme switcher in the header.
CardIndices
| Prop | Type | Default | Description |
|---|---|---|---|
| corner | boolean | true | Draw the big lower-right rank. Off for every card but the top one in an overlapping hand. |
| rank * | string | – | Rank text, with ten spelled "10". |
| sym * | string | – | Suit glyph. |
PlayingCard
| Prop | Type | Default | Description |
|---|---|---|---|
| card | string | null | – | Rank and suit, such as "Ah" or "Td". Pass null for an empty slot. |
| className | string | "" | Extra classes on the card box. |
| size | "xs" | "sm" | "md" | "lg" | md | Draw size. Defaults to md. |
MiniCard
| Prop | Type | Default | Description |
|---|---|---|---|
| card * | string | – | Rank and suit, such as "Ah" or "Td". |
| className | string | h-8 w-6 text-base | Box and font size. Defaults to a row-sized tile. |
HoleCards
| Prop | Type | Default | Description |
|---|---|---|---|
| cards * | string[] | null | – | Hole cards. Null or an empty list renders two empty slots. |
| size | "xs" | "sm" | "md" | "lg" | md | Draw size before Omaha hands shrink one step to fit. Defaults to md. |
Board
| Prop | Type | Default | Description |
|---|---|---|---|
| cards * | string[] | – | Up to five board cards. Missing streets render as empty slots. |
| size | "xs" | "sm" | "md" | "lg" | md | Draw size for every slot. Defaults to md. |