igordanchenko/yet-another-react-lightbox

Allow slides to use srcset

krokosik opened this issue · 1 comments

Is your feature request related to a problem? Please describe.

There is no documentation on using src-set instead of src for slides. Since in my lightbox I want to display large images, it would be good to optimize them for specific viewports.

Describe the solution you'd like

Allow passing a src-set instead of just src to the underlying img tag.

Describe alternatives you've considered

No response

Additional context

NextJS 14.1 stabilized the getImageProps function. Might be a good idea to update the Nextjs example, especially that it only seems to consider statically imported images and not ones from CMS.

I believe the documentation provides very specific examples of how to supply scrSet data:

Allow passing a src-set instead of just src to the underlying img tag.

Please note that this library expects srcSet prop to be supplied in addition to src, not instead.

NextJS 14.1 stabilized the getImageProps function. Might be a good idea to update the Nextjs example, especially that it only seems to consider statically imported images and not ones from CMS.

I'm not particularly clear what sort of example you expect to see, but please feel free to open a separate discussion or open PR.