react-image-lightbox
react-image-lightbox copied to clipboard
Use srcset and sizes attributes?
Is it possible to use responsive image markup (srcset
and sizes
) with react-image-lightbox?
I'd like to avoid hard-coding a single mainSrc image file to be used on every screen size... Is there a way to dynamically select the mainSrc image based on the viewport width?
Sadly, I didn't find this valuable feature either.
I need that feature, too - do be able to display normal / retina images. This markup would be better:
<img src="default.jpg" srcset="default.jpg 1x, default-retina.jpg 2x">
This would be a key, useful feature.
Yep definitely -- same with me
Looking into this. It looks like there's some styles transform the image dynamically.
with transform css in image
without css transform. at least showing the image at actual size
Basic image passing in being mocked. Let me know if you have any goals for how you'd want to pass in the srcSet, currently thinking:
// [ { intrinsicSize: '100w', imageUrl: 'https://image.jpg }]
mainSrcSet: PropTypes.array,
https://github.com/JackHowa/react-image-lightbox/tree/ISSUE-87-image-src-set