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.
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>Download dist/ from the latest release and serve it with your site. Keep LICENSE and NOTICE next to it.
<script src="/chessmen/dist/chessmen.all.js"></script>
<!-- optional second piece set -->
<script src="/chessmen/dist/pieces/modern-staunton.js"></script>Install from GitHub, pinned to a release:
npm install github:slate-chess/chessmen#v0.5.0import { create } from "chessmen/dist/chessmen.mjs";
import "chessmen/dist/pieces/classic-staunton.js";
import "chessmen/dist/chessmen.css";
create(document.getElementById("board"), { games: pgn });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.
[Event headers.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.
Options at a glance
Pass these to Chessmen.create(element, options). Full reference, methods and events: README · for AI assistants: llms.txt.
| Option | Default | What 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 |
game | 0 | Which 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 |
autoplay | true | Play through the moves (off under reduced motion) |
interval / endPause | 1100 / 3000 | Milliseconds per move / to hold the final position |
loop | true | Go on to the next game when one ends |
controls / picker / meta | true | Buttons, the game menu, players and move counter |
appearance | false | Menus that let visitors change colours and pieces |
remember | off | A storage key that keeps a visitor's choices |
theme | — | coordinates, lastMove, frame, moveDuration |
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.
| Section | Term |
|---|---|
| 2. Copyright license | Perpetual, worldwide, royalty-free right to reproduce, prepare Derivative Works of, publicly display, sublicense and distribute the Work, in personal and commercial use |
| 3. Patent license | Granted for each contributor's contributions; terminates for anyone who brings patent litigation over the Work |
| 4(a) Redistribution | Give recipients a copy of the License |
| 4(b) Modifications | Modified files must carry prominent notices that you changed them |
| 4(c) Notices | Retain all copyright, patent, trademark and attribution notices |
| 4(d) Attribution | Include 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. Trademarks | No 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 liability | Provided “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).