0.1.1 • Published 4 years ago

rid-lightbox v0.1.1

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

lightbox

A React Native Lightbox component inspired by react-native-lightbox

Setup

npm install --save rid-lightbox

Usage

    import {LightBox} from 'rid-lightbox';

    .
    .
    .

    return (
        <View style={[styles.container, containerStyle]}>
            <LightBox
                renderHeader={() => <NormalText style={{ textAlign: 'center', color: 'white' }}>"HEADER"</NormalText>}
                renderFooter={() => <NormalText style={{ textAlign: 'center', color: 'white' }}>"FOOTER"</NormalText>}
                renderContent={() => <Image source={{ uri: image }} resizeMode={'contain'} style={{width, height: width}}/>}>
                <Image source={{ uri: image }} style={[styles.image, imageStyle]}  />
            </LightBox>
        </View>
    );

Available Props

NameTypeDefaultDescription
swipeablebooleantrueEnables gestures to dismiss fullscreen mode by swiping up or down.
containerStyleViewStyleemptyStyle applied to the content.
renderHeaderfuncundefinedCustom header component.
renderContentfuncundefinedCustom content component instead of child node.
renderFooterfuncundefinedCustom footer component.
renderCloseButtonfuncundefinedCustom close button component instead of default X icon button.