paulcollett / react-masonry-css

React Masonry layout component powered by CSS, dependancy free
https://paulcollett.github.io/react-masonry-css/demo/
MIT License
961 stars 66 forks source link

Suggestion: prop on children to let them span the entire row #40

Closed ardeaf closed 5 years ago

ardeaf commented 5 years ago

Let's say your masonry is 3 columns wide, but you'd like to highlight one of them items in the list of children. It'd be cool to allow that one item to span the entire row via a prop.

paulcollett commented 5 years ago

Nice idea, and actually something you may be able to achieve currently with more control than we could work into the plugin.

So to do this you can render your full width item with 2 Masonry components. One above, with the preceding items and one below with the items that follow. When you no longer need your full width item you can return to the original 1 Masonry layout.

If you give it a go, lmk, Im curious to see if this could work out

ardeaf commented 5 years ago

I haven't had the chance to test this yet, but the workaround should work.