Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/ainurb/react-native-segment-control

Swipeable SegmentedControl component for React Native apps
https://github.com/ainurb/react-native-segment-control

animated animated-tabs control react-native segment segmentedcontrol swipe swipeable tabs

Last synced: 5 days ago
JSON representation

Swipeable SegmentedControl component for React Native apps

Awesome Lists containing this project

README

        

# react-native-segment-control

[![Platform](https://img.shields.io/badge/platform-react--native-lightgrey.svg)](http://facebook.github.io/react-native/)
[![npm version](http://img.shields.io/npm/v/react-native-segment-control.svg)](https://www.npmjs.com/package/react-native-segment-control)
[![npm downloads](https://img.shields.io/npm/dm/react-native-segment-control.svg?update=7)](http://badge.fury.io/js/react-native-segment-control)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.github.com/testshallpass/react-native-segment-control/master/LICENSE)

## Demo

## Installation

```
$ npm install react-native-segment-control --save
```

## Example

```JSX
import React from 'react';
import { View, Text, StyleSheet } from 'react-native';
import SegmentControl from 'react-native-segment-control';

const One = () => {
return This is first view;
};
const Two = () => {
return This is second view;
};
const segments = [
{
title: 'One',
view: One
},
{
title: 'Two',
view: Two
}
];
const App = () => {
return (



);
};

const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#F5F7FA',
justifyContent: 'center'
},
text: {
alignSelf: 'center',
margin: 50
}
});

export default App;
```

## TO-DO's:

- [ ] Add background color property
- [ ] Add icons as tab titles