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

https://github.com/kyle-ssg/react-native-common-elements

Common components for react native
https://github.com/kyle-ssg/react-native-common-elements

boilerplate component react-native

Last synced: over 1 year ago
JSON representation

Common components for react native

Awesome Lists containing this project

README

          

# react-native-common-elements

###### Having developed and published a large number of react-native applications and boilerplate code, of all the things I can't live without is this set of customisable layout components.

## Usage
- ```npm i react-native-common-elements --save```
- ```import { init, em, Row, FormGroup, Flex, Container, Column, Text, Bold, H1, H2, H3, H4, H5, H6, globalise } from 'react-native-common-elements';```

## Components
- ```

...

``` - text ranging from 1em to 2.5 em
- `````` - text with standardised font size and styles
- `````` - same as text but bold
- `````` - container with standardised guttering
- `````` - Horizontal view with options to space apart and negate container gutter padding
- `````` - view with flex, can override value with ``` value={x}```
- `````` columns within a row element, uses standard guttering

## Util
- ```em(value, baseValue)``` returns unit based on device width
- ```globalise()``` assigns components and em to global scope

# Customisation
Optionally you can override any style property or style variables by calling init, these are deeply merged when rendering
**see styles.js and styleVariables.js for full list of properties**
```
init({text:{color:'red'},h1:{color:'blue'}},{fontSize:16});
```

## Example
```



Text


Text2




Header 1


Header 2


Header 3


Header 4


Header 5

Header 6

Header 6




1/3


2/3



```