Swipe Up Down component
npm install react-native-swipe-up-down|Full/Mini|Hidden component|
|---|---|
|
|
|
npm install react-native-swipe-up-down --save
- OR
yarn add react-native-swipe-up-down
javascript
import SwipeUpDown from 'react-native-swipe-up-down';// TODO: What to do with the module?
itemMini={(show) => }
itemFull={(hide) => }
onShowMini={() => console.log('mini')}
onShowFull={() => console.log('full')}
animation="spring"
disableSwipeIcon
extraMarginTop={100}
iconColor='yellow'
iconSize={30}
style={{ backgroundColor: '#000' }} // style for swipe
/>
`Note
- 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`jsx
const swipeUpDownRef = useRef();
// Show component
swipeUpDownRef.current.showFull();
// This ref can help you show component when hidden component
itemFull={ }
ref={swipeUpDownRef}
/>
`- If you want to use
ScrollView inside itemFull, please add TouchableWithoutFeedback inside ScrollView.
Example
`jsx
{...}
`
More Props
$3
`jsx
animation="easeInEaseOut"
`
Optional * 'linear'
* 'spring'
* 'easeInEaseOut'
* 'none'
$3
`jsx
swipeHeight={100} // Default 60
`
$3
`jsx
extraMarginTop={24} // Default iOS: 24 | Android: 0 - Using for padding status bar iOS or max height full component
`
$3
`jsx
disableSwipeIcon={true}
``This module is MIT licensed
---