1.1.0 • Published 5 years ago

rn-closable-modal v1.1.0

Weekly downloads
8
License
MIT
Repository
github
Last release
5 years ago

This package is a closable modal for react native. This package allows to close the modal by:

  • Tapping outside of it
  • Hitting the back button on android devices

Preview

AndroidiOS

Installation

npm install rn-closable-modal

Then what ?

import ClosableModal from "rn-closable-modal"

<ClosableModal show={this.state.showModal}
               onClose={this._onModalClosed}
               orientation={"horizontal"|"vertical"}
               overlayColor={"rgba(0,0,0,0.5)"}>
    <YourModalContentComponent />
</ClosableModal>               

What are these props ?

nametyperequireddescription
showbooleanyestrue -> shown. false -> hidden.
onClosefunctionnocallback called on closing the modal (e.g. to set your state)
onLayoutCallbackfunction(event)nocallback called when the layout is ready (might be useful if you wanna know the size of some things before rendering them)
overlayColorstringnocolor of the overlay hiding the screen (rgba(0,0,0,0.5) by default)
isClosablebooleannodefines if the modal is closable or not by clicking outside or on back on android (default: true)
orientationbooleannoDefines which orientation the modal is in. Defaults to vertical.

Example

An example of implementation is available in this repository

1.1.0

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

6 years ago

1.0.0

6 years ago

0.2.0

6 years ago

0.1.7

6 years ago

0.1.6

6 years ago

0.1.5

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.0

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago