react-native-beauty-tabs
Version:
A customizable and animated tab component for React Native with beautiful sliding indicators and swipeable content.
157 lines (127 loc) โข 5.1 kB
Markdown
# react-native-beauty-tabs
A lightweight and customizable tab navigation component for React Native, built with full Expo support. Perfect for creating beautiful tabbed interfaces, modals, action sheets, and more โ with smooth animations and flexible styling.
---
## โจ Features
- โก Built for Expo & React Native
- ๐ฏ Smooth animations
- ๐
Fully customizable tabs and styling
- ๐งฉ Icon support for each tab
๐ Dynamic width ratio support
---
## ๐ฑโ๐ Coming Soon
๐ More exciting features are on the way!
๐ ๏ธ Planned updates include new enhancements and improved performance.
---
## ๐คณ Best Practices
. If you encounter an error, stop the Terminal and run the project again.
---
## ๐ผ Demo Screenshot
<img src="https://raw.githubusercontent.com/nizamuddin15bd/MyAllPackagesDemoImage/refs/heads/main/ScreenShortbeautyTabs.png" alt="react-native-beauty-tabs image" width="220" height="460" />
---
## ๐ Connect with me
- ๐ [Portfolio Website](https://www.expertsquad.net)
- โจ [Facebook](https://www.facebook.com/naem.nizam.2024)
- ๐ป [GitHub](https://github.com/nizamuddin15bd)
---
## ๐ฆ Installation
```bash
npm install react-native-beauty-tabs
# or
yarn add react-native-beauty-tabs
```
## ๐งช Example Usage
```tsx
import React from "react";
import { View, Text } from "react-native";
import { AntDesign } from "@expo/vector-icons";
import { NativeTabs } from "react-native-beauty-tabs";
const Example = () => {
return (
<View style={{ backgroundColor: "" }}>
<NativeTabs
ContainerStyle={{
backgroundColor: "#f5f5f5",
flexDirection: "column",
gap: 20,
marginTop: 20,
alignSelf: "center",
}}
Tabcontainer={{ alignSelf: "center" }}
IndicatorStyle={{
backgroundColor: "white",
borderRadius: 25,
}}
TabTextStyle={{ fontWeight: "400" }}
ActiveTextColors={"#E75480"}
InActiveTextColors="white"
TabsRowStyle={{
borderRadius: 40,
backgroundColor: "#E75480",
elevation: 10,
shadowColor: "black",
}}
PageContentStyle={{
alignItems: "center",
justifyContent: "center",
padding: 10,
}}
TabContentStyle={{ flexDirection: "row", alignItems: "center", gap: 5 }}
widthRatio={0.8}
Tabs={[
{
label: "Home",
Icons: <AntDesign name="home" size={15} color="black" />,
Content: (
<View>
<Text>Your Content</Text>
</View>
),
},
{
label: "Calendar",
Icons: <AntDesign name="calendar" size={15} color="black" />,
Content: (
<View>
<Text>Your Content</Text>
</View>
),
},
{
label: "Cart",
Icons: <AntDesign name="shoppingcart" size={15} color="black" />,
Content: (
<View>
<Text>Your Content</Text>
</View>
),
},
{
label: "Profile",
Icons: <AntDesign name="user" size={15} color="black" />,
Content: (
<View>
<Text>Your Content</Text>
</View>
),
},
]}
/>
</View>
);
};
export default Example;
```
## โ๏ธ Props
| Prop | Type | Default | Description |
| -------------------- | ----------- | ----------- | ------------------------------------------------------------------- |
| `Tabs` | `Tab[]` | `[]` | Array of tab objects (label, Icons, Content) |
| `ContainerStyle` | `ViewStyle` | `null` | Style for the main container |
| `Tabcontainer` | `ViewStyle` | `null` | Style for the tab wrapper container |
| `TabsRowStyle` | `ViewStyle` | `null` | Style for the row of tabs |
| `IndicatorStyle` | `ViewStyle` | `null` | Style for the active tab indicator |
| `TabTextStyle` | `TextStyle` | `null` | Style applied to each tab label text |
| `ActiveTextColors` | `string` | `"#fff"` | Text color for the active tab |
| `InActiveTextColors` | `string` | `"#007aff"` | Text color for inactive tabs |
| `TabContentStyle` | `ViewStyle` | `null` | Style for each tab's icon + label container |
| `PageContentStyle` | `ViewStyle` | `null` | Style for the tab content wrapper |
| `widthRatio` | `number` | `0.9` | Width ratio of the whole tab layout (0โ1, relative to screen width) |