React Chessboard is a modern, responsive, and accessible chessboard component for React applications, currently at stable version 5.10.0. It provides core functionality for rendering chessboards with drag-and-drop piece movement, custom piece rendering, animation, and comprehensive event handling. The library maintains a continuous release cadence, with frequent minor updates and bug fixes, often several times a month. Key differentiators include robust mobile support, built-in responsiveness, accessibility features, and full TypeScript support, ensuring type safety and improved developer experience. It requires React 19.0.0 as a peer dependency, aligning with the latest React ecosystem, making it suitable for modern React projects and providing a flexible foundation for building various chess-related user interfaces.
npm install react-chessboardVerified import paths — ran on the pinned version, not inferred.
Demonstrates basic setup of the Chessboard component, integrating with `chess.js` for game logic to handle piece drops, update the game state, and display the FEN.
Upgrade your project's `react` and `react-dom` dependencies to `^19.0.0` or higher. For example: `npm install react@^19.0.0 react-dom@^19.0.0`.
Ensure the component consuming `Chessboard` includes `'use client';` at the top of the file, or dynamically import the component using `next/dynamic` with `ssr: false`.
Ensure your development environment meets the specified engine requirements. Update Node.js to `v20.11.0` or newer, and pnpm to `v9.4.0` or newer.
Upgrade to `react-chessboard@5.9.1` or newer to resolve the issue with `onClick` firing incorrectly during mobile piece drops.
Install the package: `npm install react-chessboard` (or `pnpm add react-chessboard`, `yarn add react-chessboard`). Ensure you are using `import { Chessboard } from 'react-chessboard';` in an ESM-compatible environment or build setup.Update your `react` and `react-dom` packages to version `19.0.0` or newer: `npm install react@^19.0.0 react-dom@^19.0.0`.
Add `'use client';` at the top of the file where `Chessboard` is rendered, or use `next/dynamic` to import `Chessboard` with `ssr: false`.