@chess-components/board is a lightweight chessboard web component, designed for integrating chessboards seamlessly into your web applications.
To start using the chessboard component, follow these steps:
-
Install the package using npm:
npm install @chess-components/board
-
Include the necessary script tag in your HTML file to import the module:
<script type="module" src="node_modules/@chess-components/board"></script>
-
Add default styles to your HTML file to ensure the board is properly displayed:
<link rel="stylesheet" href="node_modules/@chess-components/board/dist/assets/backgrounds/brown.css" /> <link rel="stylesheet" href="node_modules/@chess-components/board/dist/assets/piecesets/cburnett.css" />
These stylesheets provide default backgrounds and piece sets for the chessboard.
-
Place the chessboard element within your HTML where you want it to appear:
<chess-board></chess-board>
@chess-components/board provides the fundamental structure for a chessboard, serving as a solid foundation for creating chess games or editors.