# react-native-easy-grid

> Easy React Native Layout & Grid for the Dumb

Latest version **0.2.2** (published 2019-08-12) · 0 weekly downloads

## Install

```sh
npm install react-native-easy-grid
pnpm add react-native-easy-grid
yarn add react-native-easy-grid
bun add react-native-easy-grid
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.2.2 |
| Published | 2019-08-12 |
| First published | 2016-05-05 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 87.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2219 |
| Maintainers | geekyants, himanshu-sahusoft, sankhadeeproy007, shivrajk |

## Links

- npm: https://www.npmjs.com/package/react-native-easy-grid
- Repository: https://github.com/GeekyAnts/react-native-easy-grid
- Homepage: https://github.com/GeekyAnts/react-native-easy-grid#readme
- Issues: https://github.com/GeekyAnts/react-native-easy-grid/issues
- npm.io page: https://npm.io/package/react-native-easy-grid

## Dependencies (1)

- [lodash](https://npm.io/package/lodash.md) ^4.17.15

## Recent versions

- 0.2.2 (latest) — 2019-08-12
- 0.2.1 — 2019-02-21
- 0.2.0 — 2018-07-06
- 0.1.17 — 2018-01-23
- 0.1.16 — 2018-01-04
- 0.1.15 — 2017-07-27
- 0.1.14 — 2017-07-13
- 0.1.11 — 2017-07-09
- 0.1.13 — 2017-05-24
- 0.1.12 — 2017-05-24
- 0.1.9 — 2017-05-18
- 0.1.8 — 2017-01-10
- 0.1.7 — 2016-11-28
- 0.1.6 — 2016-06-08
- 0.1.5 — 2016-06-07
- … 4 more at https://npm.io/package/react-native-easy-grid/versions

## README

# React Native Easy Grid 🐵
![Master Build Status](https://travis-ci.org/GeekyAnts/react-native-easy-grid.svg?branch=master) <br />

This is NOT-JUST-ANOTHER-GRID-LAYOUT library! We are trying to simplify flexbox with easier approach.

## Installation

```
npm install react-native-easy-grid --save
```

## Usage

### Include the components

```
import { Col, Row, Grid } from "react-native-easy-grid";
```

### 1. Two columns (50% and 50%)

```
<Grid>
    <Col></Col>
    <Col></Col>
</Grid>
```

![col-50-50](Examples/col-50-50.png "Column 50% and 50% example")



> Note: If you don't assign the size property, it defaults to equal width (or height) with its siblings

### 2. Two rows

```
<Grid>
    <Row></Row>
    <Row></Row>
</Grid>
```

![row-50-50](Examples/row-50-50.png "Row 50% and 50% example")


### 3. Two rows (75% and 25%)

```
<Grid>
    <Row size={75}></Row>
    <Row size={25}></Row>
</Grid>
```

This is exactly same as

```
<Grid>
    <Row size={3}></Row>
    <Row size={1}></Row>
</Grid>
```

![row-75-25](Examples/row-75-25.png "Row 75% and 25% example")

> Same concept applies to `<Col />`


### 4. Three columns (33.33% each)

```
<Grid>
    <Col></Col>
    <Col></Col>
    <Col></Col>
</Grid>
```
![col-33-33-33](Examples/col-33-33-33.png "Column 33.33% each")

### 5. Three rows (50%, 25% and 25%)

```
<Grid>
    <Row size={2}></Row>
    <Row size={1}></Row>
    <Row size={1}></Row>
</Grid>
```

![row-50-25-25](Examples/row-50-25-25.png "Row 50%, 25% and 50% example")

### 6. Nested Layout or Grid

<table width="100" height="100">
    <tr>
        <td rowspan="2" bgcolor="red" width="50">1</td>
        <td bgcolor="yellow" width="50" height="50">2</td>
    </tr>
    <tr>
        <td bgcolor="blue">3</td>
    </tr>
</table>

```
<Grid>
    <Col>
        <Text>1</Text>
    </Col>
    <Col>
        <Row>
            <Text>2</Text>
        </Row>
        <Row>
            <Text>3</Text>
        </Row>
    </Col>
</Grid>
```

![complex](Examples/complex.png "Complex and Nested Layouts")



### 7. Fixed width and fluid width combination

```
<Grid>
    <Col style={{ width: 40 }}>
        <Text>Fixed width</Text>
    </Col>
    <Col>
        <Text>Fluid width</Text>
    </Col>
</Grid>
```

![col-fluid-fixed.png](Examples/col-fluid-fixed.png "Column fluid and fixed example")


### 8. Fixed height and fluid height combination

```
<Grid>
    <Row style={{ height: 40 }}>
        <Text>Fixed width</Text>
    </Row>
    <Row>
        <Text>Fluid width</Text>
    </Row>
</Grid>
```

Do you think anything could be simpler than that? This repo is part of our bigger project called [NativeBase.io](http://nativebase.io). Do check that!

# Important note about usage with `<ScrollView />`

> Note: If you're using `<Row />` inside a `<ScrollView />`, the height of the <Row /> component would be flexible according to the content, though you can always apply the `height` styling.

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