API
ChessBoard— Main class.new ChessBoard(container: HTMLElement, options?: ChessBoardOptions).
STARTING_FEN— Standard starting position FEN string.parseFen(fen: string)— Parse FEN intoMap<SquareKey, Piece>.positionToFen(pieces: Map<SquareKey, Piece>)— Build FEN from piece map.
Themes
Section titled “Themes”defaultPieceTheme—PieceThemeusing bundled piece SVGs.defaultBoardTheme—BoardTheme(green/brown squares).
SquareKey, FileChar, RankChar, Color, PieceType, Piece, Arrow, BoardTheme, PieceTheme, ChessBoardOptions.
Board methods
Section titled “Board methods”- Position:
setPosition(fen),getPosition(). - Orientation:
setOrientation(color),getOrientation(),flip(). - Selection:
select(square | null). - Highlights:
setLastMove(from, to),clearLastMove(),setCheck(square | null),setLegalMoves(squares),clearLegalMoves(). - Arrows:
setArrows(arrows),addArrow(from, to, color?),removeArrow(from, to),clearArrows(). - Lifecycle:
destroy().