viewOnly (optional)
type viewOnly = boolean;
Enables demonstration mode for the chessboard — ideal for showing famous games, puzzles, or tutorials.
When viewOnly is set to true, pieces cannot be moved or dragged by the user.
The board’s position can only be updated programmatically through the change handler. More about change there.
In this mode, users can still draw arrows and highlight squares to illustrate ideas or visualize plans, but piece movement is fully disabled.
Code
<ChessBoard
FEN="rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1"
onChange={handleChange}
onEndGame={handleEndGame}
change={change} // <~~~ change handler
viewOnly // <~~~ flag for view only mode
/>