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

Menu

Preview

Session profit +$0.00

Win chance
49.50%
Profit on win
$1.00
  • Recent rounds show here

49.50% chance of 2× · marked cards win

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/slide-game

Import the shared styles once in your application.

TSUsage
import SlideGame from '@/components/beui/games/SlideGame.vue'
import '@/components/beui/styles.css'

API Reference

v-model:target?
number

Target multiplier (controlled). A result at or above it wins. Applies from the next round. Values below 1.01x play as 1.01x.

Default—
defaultTarget?
number

Initial target when uncontrolled. Default 2.

Default2
targets?
readonly number[]

Targets offered in the menu. Values below 1.01x are left out.

Default[1.5, 2, 3, 5, 10, 25, 100]
v-model:bet?
number

Bet amount (controlled), used for the profit readout and passed to `result`.

Default—
defaultBet?
number

Initial bet when uncontrolled. Default 1.

Default1
currency?
string

Currency symbol shown before the bet and the profit. Default "$".

Default$
formatAmount?
(amount: number) => string

Formats the profit. Default the currency symbol and two decimals ($1.50).

Default—
getResult?
() => number | Promise<number>

Decides each round's result, called once when the round starts. Return a number, or a Promise for one (a server round): the button shows Starting… until it settles, and a rejection cancels the round. Values below 1 or not finite play as 1. Default `slideResult()`.

Default—
@result?
(value: number, target: number, bet: number) => void

Called when the reel stops, with the result, the round's target and its bet. The round wins when result >= target.

Default—
duration?
number

Slide length in seconds. Default 4.

Default4
v-model:sound?
boolean

Play synthesized sounds (controlled): a tick per card into the center and a chime on a win.

Defaultundefined
defaultSound?
boolean

Initial sound state when uncontrolled. Default false.

Defaultfalse
aria-label?
string

Accessible name for the game. Default "Slide".

Default—
labels?
Partial<SlideGameMessages>

Overrides for the built-in text, e.g. for another language.

Default—
class?
string
Default—
@target-change?
(value: number) => void
Default—
@bet-change?
(value: number) => void
Default—
@sound-change?
(value: boolean) => void
Default—

Updated