# react-grid-component

> A simple react component for rendering any data-set that has x/y coodrinates.

Latest version **1.0.3** (published 2018-07-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-grid-component
pnpm add react-grid-component
yarn add react-grid-component
bun add react-grid-component
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2018-07-08 |
| First published | 2018-07-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 44.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Jacques Erasmus |
| Maintainers | jakesrassie |
| Keywords | react, grid, component, system, layout, coordinates |

## Links

- npm: https://www.npmjs.com/package/react-grid-component
- Repository: https://github.com/JakesRassie/simple-grid-system
- Issues: https://github.com/JakesRassie/simple-grid-system/issues
- npm.io page: https://npm.io/package/react-grid-component

## Recent versions

- 1.0.3 (latest) — 2018-07-08
- 1.0.2 — 2018-07-08
- 1.0.1 — 2018-07-08
- 1.0.0 — 2018-07-08

## README

# React Grid Component

A generic grid system that can render any data-set that has x/y coordinates. It can also render a custom template for each cell within the grid. 

For demo purposes this instance renders a series of interactive Bubbles and X-Team logos.

<a href="https://jakesrassie.github.io/simple-grid-system/" target="_blank">DEMO</a>

## Getting Started

Installation:
```
npm install react-grid-component --save-dev
```

Usage (basic):
```
import {Grid} from 'react-grid-component';

export class Main extends React.Component {

  render() {
    return (<Grid totalColumns="41" totalRows="21" debugMode={true} cellTemplate={<YourTemplateGoesHere>} />);
  }
```

Usage (advanced):
```
import {Grid} from 'react-grid-component';

export class Main extends React.Component {

  render() {

    let gridData = this.retrieveGridData();

    return (<Grid totalColumns="41" totalRows="21" debugMode={true} data={gridData} cellTemplate={<YourDefaultTemplate/>} />);
  }

  retrieveGridData() {
    return [
      {x: 2, y: 5, cellTemplate: <YourAmazingTemplate/>},
      {x: 4, y: 1, cellTemplate: <YourAmazingTemplate/>},
      {x: 3, y: 7, cellTemplate: <AnotherAmazingTemplate/>}
    ];
  }
}
```

## Properties

columns {array} - columns rendered on the screen, each column contains x number of cells

totalColumns {number} - the number of columns the grid consists of

totalRows {number} - the number of rows the grid consists of

width {number} - the width of the grid

height {number} - the height of the grid

data {array} - the data to be rendered on the screen

debugMode {boolean} - enables grid stats

## Preview
<img src="http://funkyimg.com/i/2J6xr.png" align="middle">

---
_Source: https://npm.io/package/react-grid-component · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
