Socket
Socket
Sign inDemoInstall

react-native-vertical-swipe-view

Package Overview
Dependencies
0
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-native-vertical-swipe-view

React Native Vertical Swipe View


Version published
Weekly downloads
198
decreased by-36.54%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

react-native-vertical-swipe-view

React Native Vertical Swipe View.

Getting started

    npm install react-native-vertical-swipe-view --save

or

    yarn add react-native-vertical-swipe-view

Demo

Props
PropsParamsisRequireDescription
visibleBooleanNo
styleViewStyleNo
headerStyleViewStyleNo
backgroundColorStringNo
maxHeightNumberYes
position'top' or 'bottom'No
renderHeader() => JSX.ElementNo
onRequestShow()=> voidNo
onRequestClose()=> voidNo

Usage

import React from 'react';
import { StyleSheet, View, SafeAreaView } from 'react-native';
import SwipeView from 'react-native-vertical-swipe-view';

const SwipeViewScreen = (_props) => {
  const _renderHeaderTop = () => {
    return (
      <View style={styles.headerTop}>
        <View style={styles.lineTop} />
      </View>
    );
  };

  const _renderHeaderBottom = () => {
    return (
      <View style={styles.headerBottom}>
        <View style={styles.lineBottom} />
      </View>
    );
  };

  return (
    <SafeAreaView style={styles.container}>
      <SwipeView
        position="top"
        style={styles.curtainView}
        maxHeight={300}
        headerStyle={{ backgroundColor: 'transparent' }}
        renderHeader={_renderHeaderTop}
      >
        <View style={styles.curtainContainer} />
      </SwipeView>

      <View style={{ flex: 1 }} />

      <SwipeView
        position="bottom"
        style={styles.curtainView}
        maxHeight={200}
        headerStyle={{ backgroundColor: 'transparent' }}
        renderHeader={_renderHeaderBottom}
      >
        <View style={styles.curtainContainer} />
      </SwipeView>
    </SafeAreaView>
  );
};

export default SwipeViewScreen;

const styles = StyleSheet.create({
  container: {
    flex: 1,
  },
  curtainView: {
    width: '100%',
  },
  curtainContainer: {
    flex: 1,
    backgroundColor: 'gray',
  },
  row: {
    flex: 1,
    flexDirection: 'row',
    justifyContent: 'space-between',
    padding: 20,
  },
  headerTop: {
    flex: 1,
    backgroundColor: 'transparent',
    justifyContent: 'center',
    alignItems: 'center',
  },
  headerBottom: {
    flex: 1,
    backgroundColor: 'black',
    borderTopLeftRadius: 22,
    borderTopRightRadius: 22,
    justifyContent: 'center',
    alignItems: 'center',
  },
  lineTop: {
    width: 40,
    height: 6,
    backgroundColor: 'gray',
  },
  lineBottom: {
    width: 40,
    height: 6,
    backgroundColor: 'white',
  },
});

Keywords

FAQs

Last updated on 08 Nov 2022

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