<Image>
Use <Image>
to display images in the <Lightbox>
.
It ensures the images are scaled to take up the available space.
It will fallback to the suspense content while loading. If an image fails to load it will throw an error.
Usage
import { LightBox, Image } from 'react-dialogs';
<LightBox onChangeIndex={setIndex} index={index}>
<Image src="/item1.png" title="Item 1" />
<Image src="/item2.png" title="Item 2" />
<Image src="/item3.png" title="Item 3" />
</LightBox>;
Props
Prop | Type | Purpose |
---|---|---|
src | String | Image src |
title | String | Image title. This will also be used as the alt is none is provided |
Any other property | Will be added to the <img /> |