You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
opacity values for the values in inputOpacityRange
[0.8, 1, 1, 1, 0.8]
Swipe back animation props
Props
type
description
default
previousCardInitialPositionX
number
initial x position of the swipe back card
0
previousCardInitialPositionY
number
initial y position of the swipe back card
-height
swipeBackAnimationDuration
number
swipe back animation duration
600
swipeBackFriction
number
swipe back spring animation friction
11
Style props
Props
type
description
default
backgroundColor
number
background color for the view containing the cards
'#4FD0E9'
marginTop
number
marginTop for the swiper container
0
marginBottom
number
marginBottom for the swiper container
0
cardVerticalMargin
number
card vertical margin
60
cardHorizontalMargin
number
card horizontal margin
20
cardHorizontalMargin
number
card horizontal margin
20
childrenOnTop
bool
render children on top or not
false
cardStyle
node
override swipable card style
{}
Methods
To trigger imperative animations, you can use a reference to the Swiper component.
Props
arguments
description
swipeBack
callback(previousCardIndex)
swipe to the previous card
jumpToCardIndex
cardIndex
set the current card index
Usage example
Example usage with a pressable button contained in the component.
render(){<Viewstyle={styles.container}><Swipercards={['DO','MORE','OF','WHAT','MAKES','YOU','HAPPY']}renderCard={(card)=>{return(<Viewstyle={styles.card}><Textstyle={styles.text}>{card}</Text></View>)}}onSwiped={(cardIndex)=>{console.log(cardIndex)}}onSwipedAll={()=>{console.log('onSwipedAll')}}cardIndex={0}backgroundColor={'#4FD0E9'}><ButtononPress={()=>{console.log('oulala')}}title="Press me">
You can press me
</Button></Swiper></View>}