Back to components
ComponentWidgetFree

Minesweeper Game React component

A Minesweeper with four glass themes, three board sizes, flood-fill reveal, right-click flagging, a live mine counter and timer, and an optional popup/widget mode.

About the Minesweeper Game component

Minesweeper Game is the classic logic puzzle. Clicking a cell opens it and shows how many of its neighbors hide a mine, empty areas open up on their own, and you win when every safe cell is open. The mines are placed after your first click, so the first cell you open is never a mine.

Three levels can be picked under the board: Beginner (9 by 9 with 10 mines), Medium (16 by 16 with 40) and Expert (16 by 30 with 99). A counter shows the mines left and a timer runs from the first click, pausing while the game is scrolled out of view. The board shrinks to fit narrow containers. theme picks night, neon, gold or tide, and lightMode switches to a light background.

When to use it

Use it as a nostalgic extra on a portfolio, a retro or developer-themed site, a 404 page or a waiting screen.

For a game that can be played with one hand on a phone, 2048 Game is a better fit, because Minesweeper needs a right-click to place flags.

Installation

Add the Minesweeper Game component to your project with the shadcn CLI. It lands in components/minesweeper-game.tsx as plain React + Tailwind CSS source you own and can edit.

Install
Copied!
npx shadcn@latest add @reactframe/minesweeper-game

Or copy the source by hand and install its dependencies:

Install
Copied!
npm install motion clsx tailwind-merge

More Widget components

Memory Match Game
Free
Snake Game
Free
Pong Game
Free
2048 Game
Free
Dino Runner Game
Free
Tic Tac Toe Game
Free