You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

react-native-animated-tabs

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-animated-tabs

Animated Tabs for React Native. Both for iOS and Android. Just swipe between tabs to navigate

1.3.3
latest
Source
npmnpm
Version published
Weekly downloads
28
86.67%
Maintainers
1
Weekly downloads
 
Created
Source

react-native-animated-tabs

Animated Tabs for React Native. Both for iOS and Android. Just swipe between tabs to navigate.

Changelog:

v 1.1.0

  • Fixed bug on Android
  • Supported navigation between tabs with external buttons (see example)

v 1.2.1

  • Reinitialisation of component when Children are changed
  • Pass onMoveShouldSetPanResponder handler to set on which swipes animation should react. For example to react only on horizontal swipes:
    onMoveShouldSetPanResponder={(a, e) => {
        return Math.abs(e.dx) > 30 && Math.abs(e.dx) > Math.abs(e.dy) * 1.5;
    }}

v 1.3 Correct support for changing orientation

Usage:

npm i react-native-animated-tabs --save

Example of usage:

<AnimatedTabs>
    <View style={styles.tabContent}>
        <Text style={styles.text}>Tab 1 Content</Text>
    </View>
    <View style={styles.tabContent}>
        <Text style={styles.text}>Tab 2 Content</Text>
    </View>
    <View style={styles.tabContent}>
        <Image style={styles.image} source={require('./images/cat1.gif')} resizeMode='stretch'/>
    </View>
</AnimatedTabs> 

More - in example folder

API:

PropertyTypeDescriptionDefault value
activePanelnumberactive panel0
animatedConfigobjectspring animation properties{ tension: 70, friction: 10 }
onAnimatefunctionanimate start callback, returns next active panel index
onAnimateFinishfunctionanimate finish callback, returns next active panel index
onMoveShouldSetPanResponderfunctionshould animation be startedundefined (start immediately)
panelStyleobjectanimated view styles
panelWidthnumberanimated view widthdeviceWidth / 1.4
swipeThresholdnumberthreshold - to start or cancel swipedeviceWidth / 7
sidePanelOpacitynumberopacity of not active panels1
sidePanelScalenumberscale of not active panels0.8

Keywords

react-native-component

FAQs

Package last updated on 31 Oct 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts