Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/tobua/react-native-cols

Grid Component for React Native
https://github.com/tobua/react-native-cols

columns flexbox grid layout react react-native

Last synced: 6 days ago
JSON representation

Grid Component for React Native

Awesome Lists containing this project

README

        



React Native Cols Preview

# React Native Cols

[![npm](https://img.shields.io/npm/v/react-native-cols)](https://npmjs.com/react-native-cols) [![Try in CodeSandbox](https://img.shields.io/badge/Try%20in-CodeSandbox-blue?style=flat-square&logo=codesandbox)](https://codesandbox.io/s/react-native-cols-35q4s)

Grid for React Native Apps.

## Installation

```
npm i react-native-cols
```

## Usage

```jsx
import React, { Component } from 'react'
import { Text } from 'react-native'
import { Cols, Col } from 'react-native-cols'

class Screen extends Component {
render() {
return (


First


Second


Third


)
}
}
```

## Props

```jsx
// Wrapper component with possible props and their defaults.

// Column component with defaults added.

```

### ``

The wrapper component sets the defaults for all `` components wrapped.

`cols` The number of columns per row.

`padding` The padding around the cols.

`colSpace` The horizontal space between cols.

`rowSpace` The vertical space between rows.

`debug` Highlights cols with a light grey background.

`style` Optional styles for the wrapper component.

`colStyle` Optional styles applied to every col, possibly overriding generated
values.

### ``

The column can be a configured with the following props:

`span` How many columns the current column should take up.

`offset` Empty columns to the left of the current column.

`left/center/right` Denotes how the content should be aligned horizontally.

`style` Optional styles added to the component, possibly overriding generated
values.

## Development

This plugin was build with [create-react-native-plugin](https://github.com/tobua/create-react-native-plugin) please refer to it's documentation on how to run the example app and make changes.