Card Dealer

Preview

Install

Add it with the shadcn CLI, or copy the source manually.

$ bunx --bun shadcn add @beui/card-dealer

API Reference

cards
T[]

Every card on the table. Order within each zone is the stacking and fan order.

Default—
renderFace
(card: T) => ReactNode

The card's face.

Default—
renderBack?
((card: T) => ReactNode)

The card's back, shown while it sits in the deck.

Default—
onCardSelect?
((id: string) => void)

Makes hand cards buttons. Called with the card's id.

Default—
cardWidth?
number

Card size in px. Default 84 by 120.

Default84
cardHeight?
number
Default120
spread?
number

Most horizontal space between neighbouring hand cards, in px. Default 46.

Default46
angle?
number

Rotation between neighbouring hand cards, in degrees. Default 5.

Default5
aria-label?
string

Accessible name for the table. Default "Card table".

Default—
labels?
Partial<{ label: string; }>

Override any built-in string.

Default—
className?
string
Default—

Keep in mind

Some components on this site are inspired by or recreated from existing work across the web. I'm not here to take credit; just to learn, experiment, and sometimes push things a bit further. If something looks familiar and I forgot to mention you, reach out and I'll fix that right away.

Updated