chessboardjs.com
Home Examples Docs Download

Basic Usage

  • Empty Board
  • Start Position
  • FEN String
  • Position Object
  • Multiple Boards

Config

  • Start Position
  • Position FEN
  • Position Object
  • Orientation
  • Notation
  • Draggable Snapback
  • Draggable Trash
  • Piece Theme String
  • Piece Theme Function
  • Animation Speed
  • Spare Pieces

Methods

  • Get Position
  • Set Position
  • Set Position Instantly
  • Clear Board
  • Move Pieces
  • Orientation
  • Destroy Board
  • Resize

Events

  • onChange
  • onDragStart
  • onDragStart Prevent Drag
  • onDragMove
  • onDrop
  • onDrop Snapback
  • onDrop Trash
  • onSnapbackEnd
  • onMoveEnd

Integration

  • Only Allow Legal Moves
  • Play Random Computer
  • Random vs Random
  • Highlight Legal Moves
  • Piece Highlighting 1
  • Piece Highlighting 2

chessboard.js is released under the MIT License

the code can be found on GitHub

by Chris Oakman