react-matrix

React Component for representing Matrixes.

Usage no npm install needed!

<script type="module">
  import reactMatrix from 'https://cdn.skypack.dev/react-matrix';
</script>

README

react-matrix

React Component for representing Matrixes.

Example

https://cirocosta.github.io/react-matrix

React Matrix

React.createClass({
  getInitialState: function () {
    return {
      matrix: [
        [0,0,0,0,0],
        [0,1,0,1,0],
        [0,1,1,1,0],
        [0,0,1,0,0],
        [0,0,0,0,0],
      ]
    }
  },

  render: function () {
    return (
      <Matrix squareSize={20} matrix={this.state.matrix} />
    );
  }
});