Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/ecreeth/rn-flex

React Native Flexbox Component
https://github.com/ecreeth/rn-flex

component flexbox flexbox-layout react-native

Last synced: 5 days ago
JSON representation

React Native Flexbox Component

Awesome Lists containing this project

README

        

# @ecreeth/rn-flex

## Flex Component Props
#### `direction`
| Property | Type | Required | Default |
|------------|--------|---------|---------|
| `row ` | string | no | -|
| `row-reverse ` | string | no | - |
| `column ` | string | no | **yes** |
| `column-reverse ` | string | no | -|
#### `justify`
| Property | Type | Required | Default |
|------------|--------|---------|---------|
| `flex-start ` | string |no|**yes**|
| `flex-end ` | string |no|-|
| `center ` | string |no|-|
| `space-between ` | string |no|-|
| `space-around ` | string |no|-|
| `space-evenly ` | string |no|-|
#### `align`
| Property | Type | Required | Default |
|------------|--------|---------|---------|
| `flex-start ` | string |no| - |
| `flex-end ` | string |no| - |
| `center ` | string |no| - |
| `baseline ` | string |no| - |
| `stretch ` | string |no| **yes** |
#### `wrap`
| Property | Type | Required | Default |
|------------|--------|---------|---------|
| `nowrap` | string |no| **yes**|
| `wrap` | string |no|-|
| `wrap-reverse` | string |no|-|
#### `flex`
| Type | Required | Default |
|--------|---------|---------|
| number |no| **1**|
## Quick Start

### Installation

Create a new React Native App:

```bash
$ react-native init HelloWorld
$ cd HelloWorld
```

Install `@ecreeth/rn-flex` to your project:

```bash
$ yarn add @ecreeth/rn-flex or
$ npm install @ecreeth/rn-flex
```

### Examples
```jsx
import React from "react";
import { StyleSheet, Text, View } from "react-native";
import Flex from "@ecreeth/rn-flex";

function App() {
return (


Default Behavior







);
}

const styles = StyleSheet.create({
container: {
flex: 1,
paddingHorizontal: 10
},
box: {
width: 200,
height: 200,
borderRadius: 5
},
red: {
backgroundColor: "#f5222d"
},
blue: {
backgroundColor: "#096dd9"
},
green: {
backgroundColor: "#237804"
}
});

export default App;
```