jaredLunde / masonic

🧱 High-performance masonry layouts for React
https://codesandbox.io/s/0oyxozv75v
MIT License
746 stars 48 forks source link

Horizontal mode #64

Open em opened 3 years ago

em commented 3 years ago

Is your feature request related to a problem? Please describe. We use masonic currently for a fullscreen view of templates in a template gallery. We also have an index view that shows single-row sliders for each infinite list. We use react-slick for this but it's not performant and very difficult to customize. If masonic could layout in a horizontal mode I could use it in both places.

Describe the solution you'd like Perhaps if there was a way to pass in our own render function that did the absolute positioning of tiles, as opposed to the current render function that is used to place content inside of pre-positioned tiles, then I could accomplish this by just swapping x and y, and providing scrollLeft to useMasonry instead of scrollTop.

Describe alternatives you've considered The whole lib could be dimensionally agnostic but that seems like a lot of work

Additional context Screen Shot 2021-01-30 at 5 50 57 PM

Screen Shot 2021-01-30 at 5 51 06 PM

jaredLunde commented 3 years ago

I agree this would be cool and I've spoken with someone on Twitter at length about potentially doing this in the past. Realistically I think I would be months away from having time to get this in.

aperkaz commented 3 years ago

I am very interested in this feature. If you could point in the right direction for implementation @jaredLunde, i can give it a shot! 🙂

jaredLunde commented 3 years ago

@aperkaz sounds great - let me know if you need any help