Open source · Apache License 2.0

chessmen

The chessboard for the web. Replay games, show positions: one script tag, zero dependencies. Paste a PGN and it replays the game, with arrows, side variations, 20 board colours and two Staunton piece sets.

PGN replayFEN diagramsArrows & circles Variations20 board colours12 piece colours SVG, crisp at any sizeKeyboard & screen readers
Install

Two lines and a PGN

Board, styles and the default pieces come in one file. Pin the version so your page never changes underneath you.

<div id="board"></div>
<script src="https://cdn.jsdelivr.net/gh/slate-chess/chessmen@v0.5.0/dist/chessmen.all.js"></script>
<script>
  Chessmen.create(document.getElementById("board"), {
    games: "1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7"
  });
</script>
Playground

Change a setting, copy the code

Every option updates the board and the code below it. When it looks right, copy the snippet into your page.

Board colours:
Show
Your code
Recipes

Copy, paste, change

Each example is editable. Change the code and press Run to see the result, then copy it. Inside each example, el is the board's element.

Reference

Options at a glance

Pass these to Chessmen.create(element, options). Full reference, methods and events: README · for AI assistants: llms.txt.

OptionDefaultWhat it does
games—PGN text (one or more games), a FEN, or an array of either
fen—Show one position, e.g. a diagram or a puzzle start
game0Which game to show first
scheme"mahogany"Board colours: one of 20, or { light, dark }
pieces"classic-staunton"Piece set: classic-staunton or modern-staunton
pieceColours"original"One of 12 pairings; amberSky for dark boards
orientation"white"Side at the bottom
autoplaytruePlay through the moves (off under reduced motion)
interval / endPause1100 / 3000Milliseconds per move / to hold the final position
looptrueGo on to the next game when one ends
controls / picker / metatrueButtons, the game menu, players and move counter
appearancefalseMenus that let visitors change colours and pieces
rememberoffA storage key that keeps a visitor's choices
theme—coordinates, lastMove, frame, moveDuration
License

Apache License 2.0

Copyright 2026 Linu Alex. Licensed under the Apache License, Version 2.0 (the “License”); you may not use this software except in compliance with the License. You may obtain a copy of the License at apache.org/licenses/LICENSE-2.0. Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

SectionTerm
2. Copyright licensePerpetual, worldwide, royalty-free right to reproduce, prepare Derivative Works of, publicly display, sublicense and distribute the Work, in personal and commercial use
3. Patent licenseGranted for each contributor's contributions; terminates for anyone who brings patent litigation over the Work
4(a) RedistributionGive recipients a copy of the License
4(b) ModificationsModified files must carry prominent notices that you changed them
4(c) NoticesRetain all copyright, patent, trademark and attribution notices
4(d) AttributionInclude the attribution notices from the NOTICE file with any distribution: in a NOTICE file, the source or documentation, or the product's credits display
6. TrademarksNo rights to the names “Slate Chess” or “chessmen”, except for reasonable and customary use in describing the origin of the Work and reproducing the NOTICE file
7–8. Warranty and liabilityProvided “AS IS”, without warranties; no liability for damages

Attribution notice (NOTICE)

Reproduce this with any distribution of chessmen or a work derived from it (Section 4(d)).

chessmen
Copyright 2026 Linu Alex
Created by Linu Alex for Slate Chess (https://slatechess.com).

Full texts: LICENSE · NOTICE · third-party notices (chess.js BSD 2-Clause, piece sets BSD 3-Clause and the Unlicense).