Skip to content
↑↓ to navigate↵ to openesc to close

Menu

Card Dealer

Preview

Install

Add it with your package manager, or copy the source manually.

Run it in a project set up with shadcn-vue. The source is copied to components/beui and its dependencies are added to your package.json. Read the shadcn-vue guide

bunx --bun shadcn-vue@latest add @beui-vue/card-dealer

Import the shared styles once in your application.

TSUsage
import CardDealer from '@/components/beui/blocks/CardDealer.vue'
import '@/components/beui/styles.css'

API Reference

cards
Card[]

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

Default—
#renderFace?
{ card: Card }

Draws the front of a card, like the `renderFace` prop of the React version.

Default—
#renderBack?
{ card: Card }

Draws the back of a card, like the `renderBack` prop of the React version.

Default—
@card-select?
(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<typeof cardDealerMessages>

Override any built-in string.

Default—
className?
string
Default—
ariaLabel?
string

Accessible name for the table.

Default—
#face?
{ card: Card }

Alias of `renderFace`.

Default—
#back?
{ card: Card }

Alias of `renderBack`.

Default—

Updated