@@ -12,6 +12,7 @@ Perfect for apps that want to:
1212Powered by React Native Reanimated, it provides butter-smooth animations while maintaining 60 FPS. The library seamlessly integrates with React Navigation's ecosystem while adding a layer of motion and interactivity that makes your app feel more dynamic and responsive.
1313
1414## 📸 How it looks
15+
1516https://github.com/user-attachments/assets/3b37176b-0ba3-43f7-b1e0-513fb514e825
1617
1718## Features
@@ -21,6 +22,8 @@ https://github.com/user-attachments/assets/3b37176b-0ba3-43f7-b1e0-513fb514e825
2122- Built-in icon support
2223- TypeScript support
2324- Works with React Navigation
25+ - Advanced animation configurations
26+ - Custom animation styles per tab
2427
2528## Installation
2629
@@ -129,12 +132,11 @@ cd ..
129132
130133``` typescript
131134import { View } from ' react-native' ;
132-
133135import { createMotionTabs } from ' react-native-motion-tabs' ;
134136import { NavigationContainer } from ' @react-navigation/native' ;
135137
136138function ExampleScreen() {
137- return <View style ={{flex: 1 }} />;
139+ return <View style ={{ flex: 1 , backgroundColor : ' white ' }} />;
138140}
139141
140142const Tabs = createMotionTabs ({
@@ -144,12 +146,33 @@ const Tabs = createMotionTabs({
144146 component: ExampleScreen ,
145147 icon: ' home' ,
146148 iconType: ' Ionicons' ,
149+ animationConfig: {
150+ stiffness: 100 ,
151+ overshootClamping: false ,
152+ restDisplacementThreshold: 0.001 ,
153+ restSpeedThreshold: 0.001 ,
154+ },
155+ animationStyle: {
156+ scale: 1.2 ,
157+ rotate: 360 ,
158+ opacity: 0.8 ,
159+ },
147160 },
148161 {
149162 name: ' Search' ,
150163 component: ExampleScreen ,
151164 icon: ' search' ,
152165 iconType: ' Ionicons' ,
166+ animationConfig: {
167+ stiffness: 100 ,
168+ overshootClamping: false ,
169+ restDisplacementThreshold: 0.001 ,
170+ restSpeedThreshold: 0.001 ,
171+ },
172+ animationStyle: {
173+ scale: 1.1 ,
174+ rotate: 180 ,
175+ },
153176 },
154177 {
155178 name: ' Favorites' ,
@@ -169,6 +192,12 @@ const Tabs = createMotionTabs({
169192 activeText: ' #FFFFFF' ,
170193 inactiveText: ' #000000' ,
171194 backgroundColor: ' #FFFFFF' ,
195+ animationConfig: {
196+ stiffness: 100 ,
197+ overshootClamping: false ,
198+ restDisplacementThreshold: 0.001 ,
199+ restSpeedThreshold: 0.001 ,
200+ },
172201 },
173202});
174203
@@ -220,3 +249,36 @@ MIT © [Filipi Rafael](https://github.com/filipirafael)
220249---
221250
222251Made with ❤️ by [ @filipiRafael3 ] ( https://x.com/filipiRafael3 )
252+
253+ ## Animation Configuration
254+
255+ The library uses React Native Reanimated's ` withSpring ` for animations. Here are the available configuration options:
256+
257+ ### Animation Config
258+
259+ - ` stiffness ` : Controls how "springy" the animation is (default: 100)
260+ - ` overshootClamping ` : Prevents the animation from overshooting its target (default: false)
261+ - ` restDisplacementThreshold ` : The minimum displacement from the target to consider the animation complete (default: 0.001)
262+ - ` restSpeedThreshold ` : The minimum speed to consider the animation complete (default: 0.001)
263+
264+ ### Animation Style
265+
266+ - ` scale ` : Scale factor for the icon when active (default: 1.2)
267+ - ` rotate ` : Rotation in degrees for the icon when active (default: 0)
268+ - ` opacity ` : Opacity value for the icon when active (default: 1)
269+
270+ Example:
271+
272+ ``` typescript
273+ animationConfig : {
274+ stiffness : 100 ,
275+ overshootClamping : false ,
276+ restDisplacementThreshold : 0.001 ,
277+ restSpeedThreshold : 0.001 ,
278+ },
279+ animationStyle : {
280+ scale : 1.2 ,
281+ rotate : 360 ,
282+ opacity : 0.8 ,
283+ }
284+ ```
0 commit comments