8

A Fullscreen Lightbox Comoponent For React Native

 2 years ago
source link: https://reactnativeexample.com/a-fullscreen-lightbox-comoponent-for-react-native/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Lightbox

A Fullscreen Lightbox Comoponent For React Native

May 26, 2022 1 min read

React Native Lightbox

basic usage

Installation

npm install @alantoa/lightbox

Usage

import { LightBoxProvider, LightBox } from '@alantoa/lightbox';
import { StyleSheet, Image, Dimensions } from 'react-native';
import * as React from 'react';

const { width } = Dimensions.get('window');

export default function App() {
  return (
    <LightBoxProvider>
      <LightBox
        width={width / 3}
        height={width / 3}
        imgLayout={{ width, height: width }}
      >
        <Image
          source={{
            uri: uri,
          }}
          style={StyleSheet.absoluteFillObject}
        />
      </LightBox>
    </LightBoxProvider>
  );
}

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

GitHub

View Github


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK