New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

react-native-backdrop

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-backdrop

Backdrop component built with Material Guidelines for React Native

latest
Source
npmnpm
Version
2.1.2
Version published
Weekly downloads
209
8.29%
Maintainers
1
Weekly downloads
 
Created
Source

React Native Backdrop

React Native Backdrop component built with material guidelines for android and ios

| Without closedHeight | With closedHeight |

Installation

$ npm install react-native-backdrop --save

Usage

import { Backdrop } from "react-native-backdrop";

const App = () => {
  const [visible, setVisible] = useState(false);
  
  const handleOpen = () => {
    setVisible(true);
  };
  
  const handleClose = () => {
    setVisible(false);
  };

  return (
    <Fragment>
      <View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
        <TouchableOpacity
          onPress={() => setVisible(true)}
          style={{
            width: 200,
            height: 40,
            justifyContent: 'center',
            alignItems: 'center',
            elevation: 1,
            backgroundColor: '#fff',
          }}>
          <Text>Handle Backdrop</Text>
        </TouchableOpacity>
      </View>
      <Backdrop
        visible={visible}
        handleOpen={handleOpen}
        handleClose={handleClose}
        onClose={() => {}}
        swipeConfig={{
          velocityThreshold: 0.3,
          directionalOffsetThreshold: 80,
        }}
        animationConfig={{
          speed: 14,
          bounciness: 4,
        }}
        overlayColor="rgba(0,0,0,0.32)"
        backdropStyle={{
          backgroundColor: '#fff',
        }}>
        <View>
          <Text>Backdrop Content</Text>
        </View>
      </Backdrop>
    );
}


Backdrop Properties

PropDescriptionDefault
childrenContent of backdrop (required)
visibleWhether the backdrop is visible (required, boolean)false
handleOpenFunction to open backdrop (required, function)() => {}
handleCloseFunction to close backdrop (required, function)() => {}
beforeCloseCallback that is called before close animation() => {}
afterCloseCallback that is called after close animation() => {}
beforeOpenCallback that is called before open animation() => {}
afterOpenCallback that is called after open animation() => {}
animationConfigConfigures Open and Close Animation speed and bounciness{speed: 14, bounciness: 4}
swipeConfigConfigures Swipe Gesture to close backdrop{velocityThreshold: 0.3, directionalOffsetThreshold: 80}
backdropStyleStyle object for backdrop styling{}
containerStyleStyle object for container styling{ backgroundColor: "#fff" }
overlayColorColor of backdrop overlayrgba(0, 0, 0, 0.32)
headerDisplay custom header in backdrop() => (<View style={styles.closePlateContainer}><View style={styles.closePlate} /></View>)
closedHeightHeight of closed backdrop that will be visible and touchable0
closeOnBackButtonClose backdrop on back button press on androidfalse

velocityThreshold - Velocity that has to be breached in order for swipe to be triggered (vx and vy properties of gestureState) directionalOffsetThreshold - Absolute offset that shouldn't be breached for swipe to be triggered (dy for horizontal swipe, dx for vertical swipe)

License

MIT License. © Alexander Bogdanov 2019-

Keywords

react-native

FAQs

Package last updated on 10 Sep 2020

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