Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-native-swipe-up-down

Package Overview
Dependencies
Maintainers
0
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-swipe-up-down

Swipe Up Down component

  • 1.2.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
210
decreased by-5.41%
Maintainers
0
Weekly downloads
 
Created
Source

React Native Swipe Up Down

npm version

Why using this lib?

  • Support iOS & Android
  • The best performance 60FPS for UI and JS when swipe up down
  • Easy to use, easy to install - no more another package, only JS


fateh999




Demo

Full/MiniHidden component

Install

npm install react-native-swipe-up-down --save

  • OR

yarn add react-native-swipe-up-down

Usage

import SwipeUpDown from 'react-native-swipe-up-down';

// TODO: What to do with the module?
<SwipeUpDown
	itemMini={(show) => <ItemFull show={show} />}
	itemFull={(hide) => <ItemFull hide={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
 const swipeUpDownRef = useRef();
 // Show component
 swipeUpDownRef.current.showFull();
 // This ref can help you show component when hidden component
 <SwipeUpDown
	itemFull={<Test />}
	ref={swipeUpDownRef}
/>
  • If you want to use ScrollView inside itemFull, please add TouchableWithoutFeedback inside ScrollView. Example
<ScrollView>
    <TouchableWithoutFeedback>
	{...}
    </TouchableWithoutFeedback>
</ScrollView>

More Props

animation

animation="easeInEaseOut" 

Optional

  • 'linear'
  • 'spring'
  • 'easeInEaseOut'
  • 'none'

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}

License

This module is MIT licensed


Keywords

FAQs

Package last updated on 08 Aug 2024

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc