Socket
Socket
Sign inDemoInstall

react-native-swipe-modal-up-down

Package Overview
Dependencies
0
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-native-swipe-modal-up-down

react native swipe up down it's animation modal to swipe down or up as Facebook comments, profile picture animation. it support flat-list and scroll view inside it without conflict with animation down and scrolling down


Version published
Maintainers
1
Install size
11.0 kB
Created

Readme

Source

react-native-swipe-modal-up-down

react native swipe up down it's animation modal to swipe down or up as Facebook comments, profile picture animation. it support flat-list and scroll view inside it without conflict with animation down and scrolling down

[N|Solid]

Getting Started

$ npm install react-native-swipe-modal-up-down

Usage

import SwipeUpDownModal from 'react-native-swipe-modal-up-down';

  let [ShowComment, setShowModelComment] = useState(false);
  let [animateModal, setanimateModal] = useState(false);

<SwipeUpDownModal
  modalVisible={ShowComment}
  PressToanimate={animateModal}
  //if you don't pass HeaderContent you should pass marginTop in view of ContentModel to Make modal swipeable
  ContentModal={
    <View style={styles.containerContent}>
      <FlatList
        data={data}
        renderItem={({item, index}) => (
          <item key={index} Data={item} />
        )}
        keyExtractor={item => item.id}
      />
    </View>
  }
  HeaderStyle={styles.headerContent}
  ContentModalStyle={styles.Modal}
  HeaderContent={
    <View style={styles.containerHeader}>
          <Button 
              Title={"Press Me"}
              onPress={() => {
                setanimateModal(true);
              }}
           />
    </View>
  }
  onClose={() => {
      setModelComment(false);
      setanimateModal(false);
  }}
/>

const styles = StyleSheet.create({
  containerContent: {flex: 1, marginTop: 40},
  containerHeader: {
    flex: 1,
    alignContent: 'center',
    alignItems: 'center',
    justifyContent: 'center',
    height: 40,
    backgroundColor: '#F1F1F1',
  },
  headerContent:{
    marginTop: 0,
  },
  Modal: {
    backgroundColor: '#005252',
    marginTop: 0,
  }
});


props

PropsTypedefaultNote
modalVisibleBooleanfalseSet visiablity of Modal
ContentModalReact Elementnullfor example: <View><Button text="Hello Mina" align="center" onPress={() => {}}/></View>
ContentModalStyleanyopacity, flex: 1, marginTop: 55you shouldn't pass opacity or transform
HeaderContentReact Elementnullfor example: <View style={{flex: 1, alignContent: 'center', alignItems: 'center', justifyContent: 'center', height: 40}}><Text> Header Content </Text></View>
HeaderStyleanyopacity, width: 700, marginTop: 50, position: 'absolute'you shouldn't pass opacity or transform
onClosefunc() => nullCalled when Modal closed
ImageBackgroundModalimagenullyou can set imagebackground of modal instead of backgroundColor
ImageBackgroundModalStyleanynullfor example : borderTopLeftRadius: 25, borderTopRightRadius: 25
durationmilliseconds450Length of animation
DisableHandAnimationBooleanfalseDisable Hand animate
PressToanimateBooleannullclose modal showing animation by set value equal true
PressToanimateDirectionString'down'Direction of animating Modal while closing, accepted value('up','down').
OpenModalDirectionString'down'Direction of animating Modal while Opening, accepted value('up','down').
fadeBooleantruefading animation while opening/closing
MainContainerModalstylebackgroundColor: 'rgba(0, 0, 0, 0.5)',flex:1Main Container of modal

Keywords

FAQs

Last updated on 26 Sep 2021

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc