Masonry
Elements of different sizes are laid out without gaps.
Usage
<div data-unitone-layout="masonry">
<img src="..." alt="" />
<img src="..." alt="" />
<img src="..." alt="" />
<img src="..." alt="" />
<img src="..." alt="" />
<img src="..." alt="" />
<img src="..." alt="" />
<img src="..." alt="" />
<img src="..." alt="" />
<img src="..." alt="" />
</div>Props
HTML -gap:{variation} / JSX gap={variation}
Gap.
Can be set from -3 to 7. For variations 2 and above, clamp is used to adjust the margins so that they do not become too large on small screens.
If it is 1 or more, adding s will shrink it to size -1 on mobile. (e.g. 1s)
If it is 2 or more, adding m will shrink it to size 1 on mobile. (e.g. 2m)
<div data-unitone-layout="masonry -gap:-2">
...
</div>HTML --unitone--column-width / JSX columnWidth={value}
Column width.
--unitone--column-width specifies the ideal width of the column.
<div data-unitone-layout="masonry" style="--unitone--column-width: 250px">
...
</div>Last updated on