amankaushik481

Masonry Grid

Cards

About

A masonry layout that packs cards of uneven height into columns while keeping source (and keyboard/screen-reader) order, for galleries, notes, and testimonials.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Masonry Grid to your project and fits it to your theme.

Code

How Masonry Grid is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

import { MasonryGrid } from "@/components/ui/masonry-grid";

const NOTES = [
  {
    author: "Maya Chen",
    text: "Northwind wants net 45 on the next renewal. Fine if the volume commit stays.",
  },
  {
    author: "Theo Okafor",
    text: "Bank sync matched 212 of 219 transfers this week. The 7 misses were missing references.",
  },
  {
    author: "Priya Raman",
    text: "Pricing page copy is drafted. Needs a pass on the enterprise tier wording, the current version promises SSO on every plan which is not true, and a decision on whether we show annual prices first.",
  },
  { author: "Sam Lowe", text: "Deploy window moved to 17:00 Thursdays." },
  {
    author: "Maya Chen",
    text: "Helix Biotech asked for a PO field on invoices. Two other customers asked for the same thing in September, so it should move up the list.",
  },
  { author: "Theo Okafor", text: "INV-2033 reminder sent." },
];

export default function MasonryGridDemo() {
  return (
    <MasonryGrid
      aria-label="Team notes"
      minColumnWidth={200}
      gap={16}
      className="max-w-2xl"
    >
      {NOTES.map((n, i) => (
        <div
          key={i}
          className="rounded-xl border border-border bg-surface p-4 shadow-raised"
        >
          <p className="text-sm leading-[1.55] text-fg">{n.text}</p>
          <p className="mt-3 text-xs text-fg-muted">{n.author}</p>
        </div>
      ))}
    </MasonryGrid>
  );
}

More by amankaushik481

View all
  • Chip Filter

    Chip Filter

    7
  • Icon Button

    Icon Button

    5
  • Background Boxes

    Background Boxes

    4
  • Emoji Picker

    Emoji Picker

    4
  • Morphing Text

    Morphing Text

    2
  • Typing Text

    Typing Text

    1
  • Treemap Chart

    Treemap Chart

    1
  • Particles

    Particles

    1

More in Cards

View all
  • Course Design Cards

    Course Design Cards

    1.3K
  • Photo Deck

    Photo Deck

    47
  • Folded Card

    Folded Card

    45
  • Statistics Card 10

    Statistics Card 10

    304
  • Statistics Card 2

    Statistics Card 2

    309
  • Statistics Card 7

    Statistics Card 7

    336
  • CTA Section

    CTA Section

    6
  • Liquid Glass Card

    Liquid Glass Card

    198