React Images, Texts or Videos
A simple, responsive Lightbox component for ReactJS to display an array of images, texts or videos.
Examples
Getting Started
1. Install using npm:
npm install react-images-texts-videos --save
2. Example with images:
<Lightbox
items={{
type:'images',
content: [
{ src: '../images/photo-1.jpg' },
{ src: '../images/photo-2.jpg' }
]}}
isOpen={this.state.lightboxIsOpen}
onClickPrev={this.gotoPrevLightboxImage}
onClickNext={this.gotoNextLightboxImage}
onClose={this.closeLightbox}
/>
3. Example with texts:
<Lightbox
items={{
type:'texts',
content: [
'Text1...',
'Text2...'
]}}
isOpen={this.state.lightboxIsOpen}
onClickPrev={this.gotoPrevLightboxText}
onClickNext={this.gotoNextLightboxText}
onClose={this.closeLightbox}
/>
3. Example with videos:
<Lightbox
items={{type:'videos', items: ['videoId1', 'videoId2']}}
isOpen={this.state.lightboxIsOpen}
onClickPrev={this.gotoPrevLightboxText}
onClickNext={this.gotoNextLightboxText}
onClose={this.closeLightbox}
/>
License
React Images is free to use for personal and commercial projects under the MIT license.
Attribution is not required, but greatly appreciated. It does not have to be user-facing and can remain within the code.
Help
Have a question?
Follow the quick start guide on GitHub to get up and running quickly. Please do not use Github Issues to report personal support requests.
Found a bug?
If you find a bug, please read the Contribution Guildelines before you report the issue.