Masonry

PreviousNext

Responsive masonry layout with animated reflow + gaps optimization.

Docs
react-bitscomponent

Preview

Loading preview…
Masonry/Masonry.css
.list {
  position: relative;
  width: 100%;
  height: 100%;
}

.item-wrapper {
  position: absolute;
  will-change: transform, width, height, opacity;
  padding: 6px;
  cursor: pointer;
  top: 0;
  left: 0;
}

.item-wrapper > .item-img {
  position: relative;
  background-size: cover;
  background-position: center center;
  width: 100%;
  height: 100%;
  text-transform: uppercase;
  font-size: 10px;
  line-height: 10px;
  border-radius: 10px;
  box-shadow: 0px 10px 50px -10px rgba(0, 0, 0, 0.2);
}

Installation

npx shadcn@latest add @react-bits/Masonry-TS-CSS

Usage

import { MasonryTSCSS } from "@/components/Masonry-TS-CSS"
<MasonryTSCSS />