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

Menu

Preview

Best cash out 0.00×

Mine count. Current value: 3 mines
3 mines
1.00×

First pick 88% safe

Tiles

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/mines

Import the shared styles once in your application.

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

API Reference

size?
number

Tiles per side, rounded, at least 2. Default 5 (a 5 × 5 board). Changing it ends the round.

Default5
v-model:mines?
number

Mines on the board (controlled), rounded and kept between 1 and tiles − 1. Takes effect from the next round.

Default—
defaultMines?
number

Initial mine count when uncontrolled. Default 3.

Default3
@reveal?
(tile: number, kind: Tile, multiplier: number) => void

Called for every tile picked during a round; a mine reports multiplier 0 and ends it.

Default—
@cash-out?
(multiplier: number, gems: number) => void

Called when the player cashes out, or clears every gem.

Default—
v-model:sound?
boolean

Play synthesized sounds (controlled): gem chimes, a mine blast and a cash-out arpeggio.

Defaultundefined
defaultSound?
boolean

Initial sound state when uncontrolled. Default false.

Defaultfalse
showResult?
boolean

Show the result card when a round ends. Default true.

Defaulttrue
aria-label?
string

Accessible name for the game. Default "Mines".

Default—
labels?
Partial<MinesMessages>

Override built-in text for this instance.

Default—
class?
string
Default—
random?
() => number

Injectable random source for the mine layout, for reproducible rounds.

DefaultMath.random()
@mines-change?
(count: number) => void
Default—
@sound-change?
(value: boolean) => void
Default—

Updated