igordanchenko / react-photo-album

Responsive photo gallery component for React
https://react-photo-album.com
MIT License
567 stars 35 forks source link

Ability to make an image full-width #163

Closed canastro closed 7 months ago

canastro commented 8 months ago

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

I have a Rows layout, but I want a particular image to standout and completely fill the entire row.

Describe the solution you'd like

The easiest way from a consumer standpoint would be to have this as a configuration in the "Photo"

Describe alternatives you've considered

No response

Additional context

No response

igordanchenko commented 7 months ago

While this isn't something supported by this library's layout algorithm, there is a straightforward way to implement the desired layout by stacking multiple photo albums on top of each other:

<>
  <PhotoAlbum layout="rows" spacing={10} photos={photos.slice(0, 3)} />
  <PhotoAlbum
    layout="rows"
    photos={photos.slice(3, 4)}
    componentsProps={{ containerProps: { style: { margin: "10px 0" } } }}
  />
  <PhotoAlbum layout="rows" spacing={10} photos={photos.slice(4)} />
</>

Does this address your use case?

I'm not keen on implementing this as a library feature at this point, as I'm not sure how well such layouts would look on various viewport sizes (specifically, desktop vs mobile). Please feel free to share some screenshots of what you are building.

canastro commented 7 months ago

It works perfectly, thank you!

https://github.com/igordanchenko/react-photo-album/assets/1267623/f6f0ecd0-3f8a-4ed1-88f9-43ed34317575