Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-native-zoombox

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-zoombox

Popover content with zoom animation for react native

  • 0.2.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

react-native-zoombox

A zoomable Box for React Native

Installation

npm install --save react-native-zoombox

Usage

import ZoomBox from 'react-native-zoombox';

class ZoomBoxExample extends React.Component {
  render() {
    return (
      <ZoomBox>
        <Image
          style = {{ flex: 1 }}
          source = {{ uri: 'http://www.placehold.it/800x600' }} />
      </ZoomBox>
    );
  }
}

Properties

PropertyTypeDefaultDescription
backgroundColorstring#000Background color of modal
backgroundOpacityfloat1Opacity of modal background
underlayColorstring#fffUnderlay color of touchable
hideStatusBarbooleantrueFullscreen modal with hidden status bar (There is a Bug on Android with Modals, where a hidden StatusBar is not working correctly, see: RN Issue #7474)
swipeToClosebooleanfalseClose modal on vertical or horizontal swipe (WIP works, but opacity does not change in both dimension)
customHeaderfunction(closeAction)NULLFunction, that returns markup for a custom header with invokes the closeAction
customContentfunctionchildrenUse different content in modal
customAnimationfunction(startValue, endValue)NULLFunction, that returns custom animation for opening/closing the modal. Default: Animated.spring(startValue, {toValue: endValue, tension: 30, friction: 7})
inModalPropsobjectnullSet different properties to content when in modal

Example

For more examples check the demo folder

Custom header function

This is an example for a custom header:

_customHeader(closeModal) {
  return (
      <TouchableHighlight onPress = {closeModal}>
        <Text style = {styles.closeButton}>Close</Text>
      </TouchableHighlight>
  )
}

Custom animation function

This is an example for a custom animation:

_customAnimation(startValue, endValue) {
  return (
    Animated.timing(
      startValue,
      {toValue: endValue, duration: 1000}
    )
  )
}

Keywords

FAQs

Package last updated on 24 Jan 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc