react-minesweeper

1.0.2 • Public • Published

react-minesweeper

react-minesweeper is a classic minesweeper game written as a React component. You can set the amount of fields and a bomb chance. Styles are only applied by CSS classes so it's easy to customize.

Link to the demo


Installation:

npm install --save react-minesweeper

Usage:

Import the default styling as shown in the demo page or create your own styles

import "react-minesweeper/lib/minesweeper.css";

Render the component

 <Minesweeper
    onWin={() => console.log("GAME WON")}
    onLose={() => console.log("GAME LOST")}
    bombChance={0.15} // 15% chance that a field will contain a bomb
    width={10} // amount of fields horizontally
    height={10} // amount of fields vertically
/>

Is there something wrong?

Please tell me!

Package Sidebar

Install

npm i react-minesweeper

Weekly Downloads

4

Version

1.0.2

License

MIT

Unpacked Size

560 kB

Total Files

24

Last publish

Collaborators

  • ol-web