1.0.0 • Published 6 years ago

rn-popup-modal v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

rn-popup-modal

Display visual popup modal

Features

  • Support in React Native for both Android and iOS
  • Possible to wrap more than one child component
  • Easy to use
  • Some customizations

Demo

Installation

  • Using Npm
npm install rn-popup-modal --save
  • Using Yarn
yarn add rn-popup-modal

Example

import RNPopupModal from 'rn-popup-modal';

<RNPopupModal ref={ref => (this._modal = ref)} title='The Pyrenees'>
  <Image
    source={{
      uri:
        'https://www.smartertravel.com/uploads/2012/03/stm4f4fa817459b420120301.jpg'
    }}
    style={styles.image}
    resizeMode='cover'
  />
  <Text style={styles.title}>
    Best Hidden Destination for Mountain Lovers: The Pyrenees
  </Text>

  <Text style={{ fontSize: 16 }}>
    “The Pyrenees in southern France and northern Spain [are] everything people
    crave about the Alps with a fraction of the people. [They have so much to
    offer, including] incredible high-country national parks in Gavarnie,
    Ordesa, and Aiguestortes; hearty regional cuisine; the running of the bulls
    in Pamplona—and even duty-free shopping in tiny Andorra.”
  </Text>
</RNPopupModal>

// Call the method to show the popup modal
_modal.show();

Usage

Available props

NameTypeDefaultDescription
titlestringString as title displayed on top header of the modal
titleStylestyleStyle of the title Text component
blockBackgroundColorcolorrgba(0,0,0,0.5)Background color of the blocking component behind the popup window
backgroundColorcolor#ffffffBackground color of the popup modal window
windowContainerStylestyleContainer style for the popup modal window
headerLineStylestyleStyle of divider line between header and body
headerContainerStylestyleContainer style for the header
scrollViewStylestyleScroll view style
scrollViewContentContainerStylestyleContent container style for the scroll view
transitionDurationnumber200Transition duration to animate the popup modal
transitionFromScalenumber1.1Start scale for transiting the popup modal

also inherit Modal Props

Available instance method

NameDescription
showShow the popup modal

License