Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/alantoa/react-native-lottie-tabbar

✨ A lottie animation tab bar written in react-native-reanimated v2.
https://github.com/alantoa/react-native-lottie-tabbar

Last synced: 8 days ago
JSON representation

✨ A lottie animation tab bar written in react-native-reanimated v2.

Awesome Lists containing this project

README

        


React Native Lottie Tabbar


A lottie animation tab bar written in react-native-reanimated v2.






## Installation

First you have to follow installation instructions of [react-native-reanimated v2](https://docs.swmansion.com/react-native-reanimated/) and [react-native-lottie](https://github.com/lottie-react-native/lottie-react-native).

⚠️ Currently only supported `react-navigation >=5`.

```sh
npm install react-native-lottie-tabbar
or
yarn add react-native-lottie-tabbar
```

## Usage

```tsx
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
import { NavigationContainer } from '@react-navigation/native';
import React, { useEffect, useState } from 'react';
import { View } from 'react-native';
import LottieTabbar, { TabItem } from 'react-native-lottie-tabbar';
const BottomTab = createBottomTabNavigator();

export enum RootScreenEnum {
RootTab1 = 'home',
RootTab2 = 'community',
RootTab3 = 'cars',
RootTab4 = 'notice',
}

const getViewStyle = (color: string) => ({
flex: 1,
backgroundColor: color,
});

const RootTab1 = () => {
return ;
};
const RootTab2 = () => {
return ;
};
const RootTab3 = () => {
return ;
};
const RootTab4 = () => {
return ;
};

const tabs: TabItem = {
[RootScreenEnum.RootTab1]: {
title: 'Home',
lottieFile: require('./lottie/home.json'),
iconSize: 24,
textWidth: 30,
},
[RootScreenEnum.RootTab2]: {
title: 'Community',
lottieFile: require('./lottie/community.json'),
iconSize: 24,
textWidth: 60,
},
[RootScreenEnum.RootTab3]: {
title: 'Cars',
lottieFile: require('./lottie/car.json'),
iconSize: 24,
textWidth: 24,
},
[RootScreenEnum.RootTab4]: {
title: 'Message',
lottieFile: require('./lottie/notice.json'),
iconSize: 24,
textWidth: 46,
isShowBadge: true,
badgeCount: 1,
},
};

const App = () => {
return (

}
screenOptions={{
headerShown: false,
}}
>






);
};

```

## Contributing

See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.

## License

MIT