tim-soft / react-spring-lightbox

📷 A flexible image gallery lightbox with native-feeling touch gestures and buttery smooth animations, built with react-spring.
https://timellenberger.com/libraries/react-spring-lightbox
MIT License
243 stars 27 forks source link

Use Next.js image component instead of vanilla img element. #59

Open Arsh1a opened 1 year ago

Arsh1a commented 1 year ago

Is there a way to replace img element with Image component from Next.js?

breadadams commented 1 year ago

+1, it would be great if you could provide a custom component (similar to the render props for header, next/prev buttons, etc) allowing users to render their own image element.

breadadams commented 1 year ago

From taking a look at the code here this would mean moving the click/drag events and styling to a parent element, to keep things as simple as possible. I'm happy to put something together if it's welcome @tim-soft.

tim-soft commented 1 year ago

@breadadams this would be a great addition to the library, not only to support next/image but also any arbitrary nodes -- it makes the lightbox a lot more flexible

what kind of api/prop change would you propose for this to work?

edit: PRs are always appreciated 👍

trebeljahr commented 1 year ago

+1 from me as well. This would be super awesome.