rexxars / react-chess

Renders a chess board using React
https://rexxars.github.io/react-chess/
MIT License
83 stars 23 forks source link
react-chess

react-chess

npm versionBuild Status

Renders a chess board using React

Installation

npm install --save react-chess

Demo

Usage

Default lineup, movable pieces

const React = require('react')
const ReactDOM = require('react-dom')
const Chess = require('react-chess')

ReactDOM.render(<Chess />, document.getElementById('main'))

Specifying lineups

const React = require('react')
const ReactDOM = require('react-dom')
const Chess = require('react-chess')

const lineup = ['R@h1', 'P@f2', 'q@d8', 'R@a1', 'P@a2', 'P@c2', 'b@c8', 'p@d7', 'Q@d1', 'n@g8']

ReactDOM.render(<Chess pieces={lineup} />, document.getElementById('main'))

Properties

License

MIT © Espen Hovlandsdal