react-chessboard-ui 2.9.0 → 2.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -12
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +2 -1
- package/dist/index.modern.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -3,9 +3,14 @@
|
|
|
3
3
|
[](https://www.npmjs.com/package/react-chessboard-ui)
|
|
4
4
|
[](https://standardjs.com)
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
<p align="center">
|
|
7
|
+
<img src="./blob/default.png?raw=true" width="23%" alt="Default react-chessboard-ui board" />
|
|
8
|
+
<img src="./blob/customization.png?raw=true" width="23%" alt="Customized react-chessboard-ui board" />
|
|
9
|
+
<img src="./blob/colorfull_arrows.png?raw=true" width="23%" alt="React chessboard with colorful arrows" />
|
|
10
|
+
<img src="./blob/all_queens.png?raw=true" width="23%" alt="React chessboard with custom pieces" />
|
|
11
|
+
</p>
|
|
7
12
|
|
|
8
|
-
|
|
13
|
+
An all-in-one React chessboard component with both the chess engine and UI included. Drop it into your React app and get a ready-to-use chessboard without wiring up separate chess logic, move validation, or board state tools. Control the board position with simple FEN notation and react to moves or game-end events through callbacks.
|
|
9
14
|
|
|
10
15
|
## 📘 **Full documentation**: [https://react-chessboard-ui.dev/](https://react-chessboard-ui.dev/)
|
|
11
16
|
|
|
@@ -14,10 +19,18 @@ A lightweight and customizable React chessboard component built with modern UI i
|
|
|
14
19
|
## 🚀 Features
|
|
15
20
|
|
|
16
21
|
- 🎯 Fully controlled via FEN strings
|
|
22
|
+
- ♟️ Built-in chess engine and ready-made board UI
|
|
23
|
+
- ✅ Move validation included
|
|
17
24
|
- ♻️ React functional component with hooks support
|
|
18
25
|
- 🎨 Customizable styles (via CSS or override)
|
|
19
26
|
- ♟️ Game-end and move-change callbacks
|
|
20
|
-
- 🧩
|
|
27
|
+
- 🧩 No extra chess packages or setup required
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Why react-chessboard-ui?
|
|
32
|
+
|
|
33
|
+
`react-chessboard-ui` is designed for developers who need a React chessboard, chess UI, and chess engine in one package. It is not just a board renderer: it provides drag-and-drop chess pieces, FEN-based position control, legal move handling, game-end detection, and customization options out of the box.
|
|
21
34
|
|
|
22
35
|
---
|
|
23
36
|
|
|
@@ -46,19 +59,16 @@ import 'react-chessboard-ui/dist/index.css'; // Required CSS
|
|
|
46
59
|
|
|
47
60
|
export const App = () => {
|
|
48
61
|
return (
|
|
49
|
-
<
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
/>
|
|
55
|
-
</div>
|
|
62
|
+
<ChessBoard
|
|
63
|
+
FEN="rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1"
|
|
64
|
+
onChange={handleChangePosition}
|
|
65
|
+
onEndGame={handleEndGame}
|
|
66
|
+
/>
|
|
56
67
|
);
|
|
57
68
|
};
|
|
58
69
|
```
|
|
59
70
|
|
|
60
71
|
## Full customizable
|
|
61
|
-
<img src="./blob/customization.png?raw=true" width="400px" alt="react-chessboard-ui preview" />
|
|
62
72
|
|
|
63
73
|
### 📘 **Documentation for customization**: [https://react-chessboard-ui.dev/properties/config/](https://react-chessboard-ui.dev/properties/config/)
|
|
64
74
|
|
|
@@ -82,4 +92,4 @@ MIT © [react-chessboard-ui](https://github.com/)
|
|
|
82
92
|
|
|
83
93
|
## 🧠 Keywords (for discoverability)
|
|
84
94
|
|
|
85
|
-
`react` `chess` `chessboard` `react-
|
|
95
|
+
`react` `react-chess` `react-chessboard` `react-chessboard-ui` `js-chess` `chess` `chessboard` `chessboard component` `chess engine`
|
package/dist/index.js
CHANGED
|
@@ -2444,7 +2444,8 @@ var useChessBoardInteractive = function useChessBoardInteractive(props) {
|
|
|
2444
2444
|
if (!onClickByChessBoard) return;
|
|
2445
2445
|
onClickByChessBoard({
|
|
2446
2446
|
cellData: cellData,
|
|
2447
|
-
pos: pos
|
|
2447
|
+
pos: pos,
|
|
2448
|
+
currentColor: currentColor
|
|
2448
2449
|
});
|
|
2449
2450
|
};
|
|
2450
2451
|
var selectFigureFrom = function selectFigureFrom(cellPos, extActualState) {
|