rn-modal-window

1.1.2 • Public • Published

rn-modal-window

version downloads

Prerequisites

This library is pure react-native component, so just have fun on it

Installation

To install this component to your react-native project, please just following this instruction bellow.

#on your root project, enter command 
$ npm install --save rn-modal-window
 

Example code

To install this component to your react-native project, please just following this instruction bellow.

import React, {Component} from 'react';
import {Text, View} from 'react-native';
import ModalWindow from "rn-modal-window";
 
export default class App extends Component<Props> {
  componentDidmount = () => {
    this.modalExample.show()
  }
  closeModalExample = () => {
    this.modalExample.dismiss();
  }
  render() {
    return (
      <ModalWindow title = { 'your moadl title' } ref = { ref => this.modalExample = ref }       actionRender = {() => (
        <TouchableOpacity onPress = { this.closeModalExample }>
          <Text>Close</Text>
        </TouchableOpacity>
      )} width = {"90%"} >
        <Text>example modal</Text>
      </ModalWindow>
    );
  }
}
 

defaultProps

So you can add many properties, you can look at the list of defaultprops / properties

// Propeties 
 
ModalWindow.defaultProps = {
  actionRender: undefined,
  width: '90%',
  height: modularHeight(.6),
  isShow: false,
  onDismiss: () => null, // only ios
  headerStyle: {},
  headerBtn: () => null,
  headerTitleStyle: {}
}
 

Dependencies

no depedencies, its all use eact-native component

License

MIT Licences

Package Sidebar

Install

npm i rn-modal-window

Weekly Downloads

3

Version

1.1.2

License

MIT

Unpacked Size

8.52 kB

Total Files

7

Last publish

Collaborators

  • ridwan_foxdream