# react-native-zoombox

> Popover content with zoom animation for react native

Latest version **0.2.1** (published 2017-01-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-native-zoombox
pnpm add react-native-zoombox
yarn add react-native-zoombox
bun add react-native-zoombox
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.1 |
| Published | 2017-01-24 |
| First published | 2017-01-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Sebastian Flor |
| Maintainers | suffle |
| Keywords | react-native |

## Links

- npm: https://www.npmjs.com/package/react-native-zoombox
- Repository: https://github.com/suffle/react-native-zoombox
- Homepage: https://github.com/suffle/react-native-zoombox#readme
- Issues: https://github.com/suffle/react-native-zoombox/issues
- npm.io page: https://npm.io/package/react-native-zoombox

## Recent versions

- 0.2.1 (latest) — 2017-01-24
- 0.2.0 — 2017-01-24
- 0.1.0 — 2017-01-22

## README

# react-native-zoombox
A zoomable Box for React Native

## Installation
```
npm install --save react-native-zoombox
```

## Usage
```javascript
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
| Property | Type | Default | Description |
| --- | --- | --- | --- |
| `backgroundColor` | string | #000 | Background color of  modal|
| `backgroundOpacity` | float | 1 | Opacity of  modal background|
| `underlayColor` | string | #fff | Underlay color of touchable |
| `hideStatusBar` | boolean | true | Fullscreen 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](https://github.com/facebook/react-native/issues/7474))|
| `swipeToClose` | boolean | false | Close modal on vertical or horizontal swipe (WIP works, but opacity does not change in both dimension) |
| `customHeader` | function(closeAction) | NULL | Function, that returns markup for a custom header with invokes the closeAction |
| `customContent` | function | children | Use different content in modal |
| `customAnimation` | function(startValue, endValue) | NULL | Function, that returns custom animation for opening/closing the modal. Default: `Animated.spring(startValue, {toValue: endValue, tension: 30, friction: 7})` |
| `inModalProps` | object | null | Set 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:
```javascript
_customHeader(closeModal) {
  return (
      <TouchableHighlight onPress = {closeModal}>
        <Text style = {styles.closeButton}>Close</Text>
      </TouchableHighlight>
  )
}
```
### Custom animation function
This is an example for a custom animation:
```javascript
_customAnimation(startValue, endValue) {
  return (
    Animated.timing(
      startValue,
      {toValue: endValue, duration: 1000}
    )
  )
}
```

---
_Source: https://npm.io/package/react-native-zoombox · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
