Security News
Combatting Alert Fatigue by Prioritizing Malicious Intent
In 2023, data breaches surged 78% from zero-day and supply chain attacks, but developers are still buried under alerts that are unable to prevent these threats.
react-native-light-box
Advanced tools
npm install --save react-native-light-box
This module requires React Native 0.11 or later
navigator
property is optional but recommended on iOS, see next section for Navigator
configuration.
var Lightbox = require('react-native-light-box');
var LightboxView = React.createClass({
render: function() {
return (
<Lightbox navigator={this.props.navigator}>
<Image
style={{ height: 300 }}
source={{ uri: 'http://knittingisawesome.com/wp-content/uploads/2012/12/cat-wearing-a-reindeer-hat1.jpg' }}
/>
</Lightbox>
);
},
});
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.
var MyApp = React.createClass({
renderScene: function(route, navigator) {
var Component = route.component;
return (
<Component navigator={navigator} route={route} {...route.passProps} />
);
},
render: function() {
return (
<Navigator
ref="navigator"
style={{ flex: 1 }}
renderScene={this.renderScene}
initialRoute={{
component: LightboxView,
}}
/>
);
}
});
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 |
onClose | function | Triggered when lightbox is closed |
onOpen | function | Triggered when 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 configuration, defaults to { tension: 30, friction: 7 } . |
FAQs
Lightbox scene transition for React Native http://plan.xyz
The npm package react-native-light-box receives a total of 1 weekly downloads. As such, react-native-light-box popularity was classified as not popular.
We found that react-native-light-box demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
In 2023, data breaches surged 78% from zero-day and supply chain attacks, but developers are still buried under alerts that are unable to prevent these threats.
Security News
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.