0.2.5 • Published 5 years ago

react-native-half-modal v0.2.5

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

react-native-half-modal

react-native-half-modal

Usage

1. Install
This library is available on npm.

npm install --save react-native-half-modal

2. Import react-native-half-modal

import { SemiModal } from 'react-native-half-modal';

3. Create a half-modal and nest its content inside of it

<SemiModal>
  <View style={{ flex: 1 }}>
    <Text>I am the half-modal content</Text>
  </View>
</SemiModal>

4. add required props (isVisible and onModalClose)

<SemiModal
  isVisible={this.state.isVisible}
  onModalClose={() => {
    this.setState({ isVisible: false });
  }}
>
  <View style={{ flex: 1 }}>
    <Text>I am the half-modal content</Text>
  </View>
</SemiModal>

For a more complex example take a look at the ./example/App.js

Props

NameTypeDefaultDescription
childrennodeREQUIREDThe modal content
isVisibleboolREQUIREDShow the modal?
onModalCloseFunctionREQUIREDCalled when the modal is hidden (usually isVisible flag change)
onModalHideFunction() => nullCalled when the modal is completely hidden
onModalShowFunction() => nullCalled when the modal is completely visible
closeThresholdnumber40Close pan threshold
styleObject{}Style applied to the modal
backgroundColorString'#00000000'Style applied to the modal background

Todo

  • Android Support
  • Create Example App
  • Write Readme
    • Props list
    • Example
  • Add threshold props

Licence

MIT

0.2.5

5 years ago

0.2.4

5 years ago

0.2.3

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.6

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.0

5 years ago