# react-native-lightbox

> Images etc in Full Screen Lightbox Popovers for React Native

Latest version **0.8.1** (published 2019-12-15) · MIT license · 0 weekly downloads

## Install

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

## 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.8.1 |
| Published | 2019-12-15 |
| First published | 2015-08-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 14.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2805 |
| Author | Joel Arvidsson |
| Maintainers | oblador |
| Keywords | react-native, react-component, react-native-component, react, mobile, ios, android, ui, lightbox, gallery, image |

## Links

- npm: https://www.npmjs.com/package/react-native-lightbox
- Repository: https://oblador@github.com/oblador/react-native-lightbox
- Homepage: https://github.com/oblador/react-native-lightbox
- Issues: https://github.com/oblador/react-native-lightbox/issues
- npm.io page: https://npm.io/package/react-native-lightbox

## Dependencies (1)

- [prop-types](https://npm.io/package/prop-types.md) ^15.7.2

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 0.8.1 (latest) — 2019-12-15
- 0.8.0 — 2018-08-28
- 0.7.0 — 2017-09-03
- 0.6.0 — 2016-05-11
- 0.5.1 — 2016-04-22
- 0.5.0 — 2015-10-14
- 0.4.1 — 2015-10-11
- 0.4.0 — 2015-10-08
- 0.3.0 — 2015-08-28
- 0.2.0 — 2015-08-05
- 0.1.1 — 2015-08-05
- 0.1.0 — 2015-08-04

## README

# react-native-lightbox

## Installation

```
yarn add react-native-lightbox
```

## Usage

`navigator` property is optional but recommended on iOS, see next section for `Navigator` configuration.

```js
import Lightbox from 'react-native-lightbox';

const LightboxView ({ navigator }) => (
  <Lightbox navigator={navigator}>
    <Image
      style={{ height: 300 }}
      source={{ uri: 'http://knittingisawesome.com/wp-content/uploads/2012/12/cat-wearing-a-reindeer-hat1.jpg' }}
    />
  </Lightbox>
);
```

### Navigator setup/Android support

For android support you must pass a reference to a `Navigator` since it does not yet have the `Modal` component and is not on the official todo list. See the `Example` project for a complete example.

```js
const renderScene = (route, navigator) => {
  const Component = route.component;

  return (
    <Component navigator={navigator} route={route} {...route.passProps} />
  );
};

const MyApp = () => (
  <Navigator
    ref="navigator"
    style={{ flex: 1 }}
    renderScene={renderScene}
    initialRoute={{
      component: LightboxView,
    }}
  />
);
```

## Properties

| Prop | Type | Description |
|---|---|---|
|**`activeProps`**|`object`|Optional set of props applied to the content component when in lightbox mode. Usable for applying custom styles or higher resolution image source.|
|**`renderHeader(close)`**|`function`|Custom header instead of default with X button|
|**`renderContent`**|`function`|Custom lightbox content instead of default child content|
|**`willClose`**|`function`|Triggered before lightbox is closed|
|**`onClose`**|`function`|Triggered when lightbox is closed|
|**`onOpen`**|`function`|Triggered when lightbox is opened|
|**`didOpen`**|`function`|Triggered after lightbox is opened|
|**`underlayColor`**|`string`|Color of touchable background, defaults to `black`|
|**`backgroundColor`**|`string`|Color of lightbox background, defaults to `black`|
|**`swipeToDismiss`**|`bool`|Enables gestures to dismiss the fullscreen mode by swiping up or down, defaults to `true`.|
|**`springConfig`**|`object`|[`Animated.spring`](https://facebook.github.io/react-native/docs/animations.html) configuration, defaults to `{ tension: 30, friction: 7 }`.|

## Demo

![Demo](https://cloud.githubusercontent.com/assets/378279/9074360/16eac5d6-3b09-11e5-90af-a69980e9f4be.gif)

## Example

Check full example in the `Example` folder.

## License

[MIT License](http://opensource.org/licenses/mit-license.html). © Joel Arvidsson

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