npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-popup-dialog-hendra

v1.0.0

Published

React Native Popup Dialog for IOS & Android.

Downloads

26

Readme

Build Status npm npm

React Native Popup Dialog

React Native Popup Dialog for iOS & Android.

Another similar dialog component: react-native-dialog-component the main difference is style.

Pull request are welcomed. Please follow Airbnb JS Style Guide

How to thank me ?

Just click on ⭐️ button 😘

Try it with Exponent

           

Installation

npm install --save react-native-popup-dialog
# OR
yarn add react-native-popup-dialog

Exposed Modules

  • Dialog
  • PopupDialog
  • DialogButton
  • DialogTitle
  • Overlay
  • Animation
  • FadeAnimation
  • ScaleAnimation
  • SlideAnimation
  • PopupDialogType
  • DialogType
  • DialogButtonType
  • DialogTitleType
  • OverlayType

Examples

Example

Usage

import PopupDialog from 'react-native-popup-dialog';
import { Button } from 'react-native'

<View style={styles.container}>
  <Button
    title="Show Dialog"
    onPress={() => {
      this.popupDialog.show();
    }}
  />
  <PopupDialog
    ref={(popupDialog) => { this.popupDialog = popupDialog; }}
  >
    <View>
      <Text>Hello</Text>
    </View>
  </PopupDialog>
</View>

Usage - With Animation

import PopupDialog, { SlideAnimation } from 'react-native-popup-dialog';

const slideAnimation = new SlideAnimation({
  slideFrom: 'bottom',
});

<View style={styles.container}>
  <PopupDialog
    ref={(popupDialog) => { this.popupDialog = popupDialog; }}
    dialogAnimation={slideAnimation}
  >
    <View>
      <Text>Hello</Text>
    </View>
  </PopupDialog>
</View>

Usage - With Dialog Dialog Title

import PopupDialog, { DialogTitle } from 'react-native-popup-dialog';

<View style={styles.container}>
  <PopupDialog
    dialogTitle={<DialogTitle title="Dialog Title" />}
    ref={(popupDialog) => { this.popupDialog = popupDialog; }}
  >
    <View>
      <Text>Hello</Text>
    </View>
  </PopupDialog>
</View>

Methods

show

this.popupDialog.show(() => {
  console.log('callback - will be called immediately')
});

dismiss

this.popupDialog.dismiss(() => {
  console.log('callback - will be called immediately')
});

Props

PopupDialog

| Prop | Type | Default | Note | |---|---|---|---| | dialogTitle? | React Element | | You can pass a DialogTitle component or pass a View for customizing titlebar | | width? | Number | Your device width | The Width of Dialog, you can use fixed width or use percentage. For example 0.5 it means 50% | height? | Number | 300 | The Height of Dialog, you can use fixed height or use percentage. For example 0.5 it means 50% | dialogAnimation? | | FadeAnimation | animation for dialog | | | dialogStyle? | any | | | | | containerStyle? | any | null | For example: { zIndex: 10, elevation: 10 } | | | animationDuration? | Number | 200 | | | | overlayPointerEvents? | String | | Available option: auto, none | | overlayBackgroundColor? | String | #000 | | overlayOpacity? | Number | 0.5 | | dismissOnTouchOutside? | Bool | true | When touch overlay will dismiss dialog, but if haveOverlay? is false then the dismissOnTouchOutside won't work| | | dismissOnHardwareBackPress? | Bool | true | Only for Android | | | haveOverlay? | Bool | true | If false won't show overlay while dialog show | | | show? | Bool | false | | | | onShown? | Function | | You can pass shown function as a callback function, will call the function when dialog shown | | | onDismissed? | Function | | You can pass onDismissed function as a callback function, will call the function when dialog dismissed | | | actions? | Array | | Array of DialogButton component for example: [<DialogButton text="DISMISS" align="center" onPress={() => this.popupDialog.dismiss()}/>] | |

DialogTitle

| Prop | Type | Default | Note | |---|---|---|---| | title | String | | | | | titleStyle? | any | | | | | titleTextStyle? | any | | | | | titleAlign? | String | center | Available option: left, center, right | | | haveTitleBar? | Bool | true | | |

DialogButton

| Prop | Type | Default | Note | |---|---|---|---| | text | String | | | | | align? | String | center | The position of the button. Available option: left, center, right | | | onPress? | Function | | | | | buttonStyle? | any | | | | | textStyle? | any | | | | | textContainerStyle? | any | | | | | disabled? | Boolean | false | | | | activeOpacity? | Number | | | |

Animation

Params for (*)Animation

FadeAnimation

Example:
new FadeAnimation({
  toValue: 0, // optional
  animationDuration: 150, // optional
  useNativeDriver: true, // optional
})

| Param | Type | Default | Note | |---|---|---|---| | toValue | Number | 0 | | | animationDuration? | Number | 150 | | | useNativeDriver? | Boolean | true | |

ScaleAnimation

Example:
new ScaleAnimation({
  toValue: 0, // optional
  useNativeDriver: true, // optional
})

| Param | Type | Default | Note | |---|---|---|---| | toValue | Number | 0 | | | useNativeDriver | Boolean | true | |

SlideAnimation

Example:
new SlideAnimation({
  toValue: 0, // optional
  slideFrom: 'bottom', // optional
  useNativeDriver: true, // optional
})

| Param | Type | Default | Note | |---|---|---|---| | toValue | Number | 0 | | | slideFrom | String | bottom | Available option: top, bottom, left, right | | useNativeDriver | Boolean | true | |

Development

yarn

yarn run build