toggleTurn (optional)
Controls whether the chessboard switches the active turn after each move.
Set toggleTurn={false} when you need the same color to move repeatedly. This is useful for learning how pieces move, building training positions, or creating quests where the user needs to make several moves with the same piece or color.
Use it together with playerColor so the board keeps accepting moves from one selected side.
Typing
type toggleTurn = boolean;
Code
// ✅ success: white can move repeatedly
<ChessBoard
FEN="8/8/8/P7/3N4/8/8/4K3 w - - 0 1"
onChange={handleChange}
onEndGame={handleEndGame}
playerColor="white"
toggleTurn={false}
/>
Without playerColor, toggleTurn={false} does not keep one selected side playable.
// 🚫 does not work: no selected player color
<ChessBoard
FEN="8/8/8/P7/3N4/8/8/4K3 w - - 0 1"
onChange={handleChange}
onEndGame={handleEndGame}
toggleTurn={false}
/>