<masonry>
Balanced columns: each child goes into the shortest column so far, like a photo feed.
<masonry columns="2"
spacing="8"
run-spacing="8">
<img src="https://hypeapps.dev/gallery/assets/landscape.jpg"
style="w-full h-160 rounded-lg"
fit="cover"/>
<img src="https://hypeapps.dev/gallery/assets/person1.jpg"
style="w-full h-220 rounded-lg"
fit="cover"/>
<img src="https://hypeapps.dev/gallery/assets/dish.jpg"
style="w-full h-200 rounded-lg"
fit="cover"/>
<img src="https://hypeapps.dev/gallery/assets/city.jpg"
style="w-full h-120 rounded-lg"
fit="cover"/>
</masonry>
Attributes
| Name | What it does | Default |
|---|---|---|
columns |
How many columns. number |
2 |
run-spacingalso run_spacing |
Gap between items in a column, px. number |
|
spacing |
Gap between columns, px (and between items when run-spacing is not given). number |
8 |
Any tag also takes gestures: @on.tap, @on.longpress, @on.doubletap and @on.swipeleft (and right, up and down). @click runs on a tap too.