README.md
February 22, 2026 ยท View on GitHub
โ๏ธ NgxChessground
The premier Angular wrapper for the world-class open-source chess UI library.
Live Demo | Report a Bug
๐ Sponsor this Project
If you are a chess lover and find this project useful, please consider sponsoring it to support further development!
Your support helps me maintain the library, add new features, and keep the application up-to-date with the latest Angular and Chessground releases.
โจ Sponsor Perk: Sponsors can request to have their favorite or "evergreen" chess game permanently added to the demo application's built-in game list!
How to add your game:
- Sponsor the project via GitHub Sponsors.
- Submit a Pull Request (PR) to this repository.
- In your PR, include the PGN file, brief game details, and your Sponsor Name.
๐ Features
๐ ๏ธ Library Features
- ๐งฉ Complete Angular Wrapper: Seamlessly adds ornicar/chessground into any Angular application.
- โก Full Compatibility: All features from the original chessground library are preserved.
- ๐ Modern Angular: Compatible with Angular 21 out of the box.
๐ฎ Application Features (PGN Viewer & Demo)
- ๐ Comprehensive PGN Viewer: Load and navigate through complex chess games effortlessly.
- โช Game Replay Options:
- Step-by-step manual replay.
- Real-time replay (watch exactly as the game was played).
- Proportional replay (fit to one minute or predefined speeds).
- Customizable minimum time delay between moves.
- ๐ Advanced Filtering:
- Filter by ECO codes, player names, and time controls.
- Dynamically filter games by playing the specific starting opening moves on the board!
- Include or exclude drawn games instantly.
- ๐ค Stockfish Integration ("Stop on error"):
- Background game analysis via Stockfish web worker.
- Auto-halts replays when a blunder or significant error occurs.
- Instantly reveals Stockfish's suggested best move and Principal Variation (PV) lines.
- ๐ก ECO Moves Tooltips: Hover over ECO codes to see the exact opening move sequence.
- ๐ญ Play Against Yourself: A specialized mode for analyzing positions or practicing openings like Robert James Fischer.
- ๐ฑ Mobile-Ready: Responsive design with interactive elements tailored for all devices.
- ๐ฅ Progressive Web App (PWA): Installable as a standalone app directly on your device.
๐ How to Use the Application
The demo application (ngx-chessground-example) is a powerful tool for exploring chess games and features. Here are a few guides to get you started:
๐ฑ Install as SPA (PWA)
- Open the live demo in a supported browser (e.g., Chrome, Edge, Safari).
- Look for the "Install" icon in the address bar (or in your browser's menu options: "Install App" or "Add to Home Screen").
- Click Install and the application will be available on your desktop/home screen, working offline where applicable.
โ๏ธ Filter by Starting Opening Moves
- Load a PGN file containing multiple games.
- In the "Filter by Starting Moves" section, check the enable box.
- Use the board to play the specific opening moves you want to filter by (e.g.,
1. e4 e5). - Click the "Filter" button. The application will instantly list only the games matching that exact opening sequence.
๐ค Use "Stop on error" (Stockfish Integration)
- Load a game into the PGN Viewer.
- Toggle the "Stop on error" checkbox.
- Start the auto-replay.
- The application analyzes the game utilizing the built-in Stockfish web worker. If a significant mistake is detected, the replay will automatically halt.
- The UI will display Stockfish's suggested best move and the optimal continuation line (PV), allowing you to study the critical moment.
๐๏ธ Repository Structure
This repository contains two robust projects:
- ๐ฆ ngx-chessground - The core Angular library.
- ๐น๏ธ ngx-chessground-example - The fully-featured demo application and PGN viewer.
๐ฆ Installation
For Users
Install the library in your Angular project via npm:
npm install ngx-chessground chess.js chessground snabbdom
For Contributors
Clone and set up the development environment quickly:
git clone https://github.com/topce/ngx-chessground.git
cd ngx-chessground
npm install
npm start
๐ป Usage Quick Start
First, import the module:
import { NgxChessgroundModule } from 'ngx-chessground';
@NgModule({
imports: [
NgxChessgroundModule
]
})
export class AppModule { }
Then use the component in your template:
<ngx-chessground
[width]="400"
[height]="400"
[config]="config">
</ngx-chessground>
๐ Documentation
To generate and view the detailed documentation locally:
npm run compodoc
The documentation server will start at http://localhost:9090
๐ Version Compatibility
| NgxChessground | Angular Framework |
|---|---|
| 21.x | 21.x |
| 20.x | 20.x |
| 19.x | 19.x |
| 18.x | 18.x |
| 17.x | 17.x |
| 16.x | 16.x |
| 15.x | 15.x |
๐ค Contributing
Contributions, issues, and feature requests are welcome! Feel free to check out the issues page or submit a Pull Request.
๐ License
Released under the GPL-3.0 License (or later).