Skip to content

elliome/react-gol

Repository files navigation

Game of Life component for react

A simple React component adds Conway's Game of Life to your website.

Installation

Install react-gol from NPM

npm i react-gol

Usage

Import ReactGol and add it to your project like so

import ReactGol from 'react-gol'

function App() {
  return (
    <div>
      <ReactGol />
    </div>
  );
}

Config

Avaliable props

    cellSize: Number        // (default: 12);
    minFrameTime: Number    // (default: 100);
    fillStyle: String       // (default: '#EEEEEE');
    motionBlur: Number      // (default: 50);
    initialCoverage: Number // (default: .125);

To customise this component, pass in props like so

import ReactGol from 'react-gol'

function App() {
  return (
    <div>
      <ReactGol cellSize={4} motionBlur={0} fillStyle={'red'} />
    </div>
  );
}

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published