Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
react-native-swipe-up-down
Advanced tools
npm install react-native-swipe-up-down --save
yarn add react-native-swipe-up-down
import SwipeUpDown from 'react-native-swipe-up-down';
// TODO: What to do with the module?
<SwipeUpDown
itemMini={(show) => (
<View
style={{
alignItems: 'center',
flex: 1,
backgroundColor: 'green',
}}>
<Text onPress={show}>
Swipe up or press me to show
</Text>
</View>
)}
itemFull={(close) => (
<View
style={{
flex: 1,
justifyContent: 'center',
backgroundColor: 'red',
}}>
<Text onPress={close}>
Swipe down or press me to close
</Text>
</View>
)}
onShowMini={() => console.log('mini')}
onShowFull={() => console.log('full')}
animation="spring"
disableSwipeIcon
extraMarginTop={100}
style={{ backgroundColor: '#000' }} // style for swipe
/>
If you want hidden component just don't pass props itemMini
. It's will hidden. And then you can use hasRef
to show it when you want.
And try to using this method to show FullComponent
const swipeUpDownRef = useRef();
// Show component
swipeUpDownRef.current.showFull();
// This ref can help you show component when hidden component
<SwipeUpDown
itemFull={<Test />}
ref={swipeUpDownRef}
/>
animation
animation="easeInEaseOut"
Optional
swipeHeight
swipeHeight={100} // Default 60
extraMarginTop
extraMarginTop={24} // Default iOS: 24 | Android: 0 - Using for padding status bar iOS or max height full component
disableSwipeIcon
disableSwipeIcon={true}
This module is MIT licensed
FAQs
Swipe Up Down component
We found that react-native-swipe-up-down demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.