Masonry Gallery with Lightbox

Gallery

Alder Row in the light it gets.

Nine photographs of the warehouse, the courtyard wing and the river walk, taken across one day in late September.

About this block

Masonry Gallery with LightboxPRO

A development gallery: a three-column masonry of nine photographs in their own ratios, each frame opening top to bottom once its file has loaded and drifting slowly against the scroll; clicking a frame opens a full-screen dark lightbox with a counter, a caption on a hairline row, previous and next pills, arrow and Escape keys, and the page scroll locked while it is open.

A gallery for a development's sales page: a rule eyebrow, a large heading and an intro, then a three-column masonry of nine photographs in their own ratios (16:9, 4:3, 3:4, 4:5 or square). Each frame opens from the top once its file has loaded and drifts slowly against the scroll. Clicking a frame opens a full-screen dark lightbox with a counter, the photograph fitted to the viewport, a caption on a hairline row and previous and next pills; the arrow keys step through, Escape closes, and the page behind cannot scroll while it is open.

Upgrade to Pro

Pro blocks install through the shadcn CLI with your license key and ship their full source. Docs and live previews stay open to everyone, so you can read every block's details first.

Upgrade Now

Installation

Swap YOUR_EMAIL and YOUR_KEY for the email and license key on your account. Find your license key on your account page.

Radix flavor

bash
npx shadcn add "https://beste.dev/r/realestate61?email=YOUR_EMAIL&license_key=YOUR_KEY"

Base UI flavor

bash
npx shadcn add "https://beste.dev/r-base/realestate61?email=YOUR_EMAIL&license_key=YOUR_KEY"

This installs the block to components/beste/block/realestate61.tsx plus the badge24 rule eyebrow, the button25 quiet pill used for the close, previous and next controls, and the shadcn/ui button primitive behind them.

Quick start

The installed file exports realestate61Demo alongside the block: the exact props behind the preview above. Spread it to get a working section in one line.

tsx
import { Realestate61, realestate61Demo } from "@/components/beste/block/realestate61";

export default function Page() {
  return <Realestate61 {...realestate61Demo} />;
}

Then replace the demo with your own props. Written out, a trimmed setup looks like this:

tsx
import { Realestate61 } from "@/components/beste/block/realestate61";

export default function Page() {
  return (
    <Realestate61
      eyebrow="Gallery"
      heading="Alder Row in the light it gets."
      description="Photographs of the warehouse, the courtyard wing and the river walk."
      photos={[
        {
          src: "https://oud.pics/b/realestate/alder-warehouse-living.webp",
          alt: "A double-height living room with a brick wall and a tall oak window",
          caption: "A warehouse living room, late morning",
          ratio: "4:3",
        },
        {
          src: "https://oud.pics/b/realestate/alder-window-sill.webp",
          alt: "An oak window and a deep concrete sill holding a stoneware bowl",
          caption: "A sill in the courtyard wing",
          ratio: "3:4",
        },
        {
          src: "https://oud.pics/b/realestate/alder-courtyard-exterior.webp",
          alt: "The warehouse and the concrete wing around a birch courtyard",
          caption: "The courtyard between the two buildings",
          ratio: "16:9",
        },
      ]}
      labels={{ open: "Open photo", close: "Close", previous: "Previous", next: "Next", of: "of" }}
    />
  );
}

Props

PropTypeDefaultDescription
eyebrowstring–Short line above the heading, rendered through badge24.
headingstring–Section heading.
descriptionstring–Intro paragraph beside the heading, bottom-aligned on desktop.
photosPhoto[][]The photographs in the masonry, in order; each carries its own ratio so nothing is cropped.
labelsLabels{}Accessible names for the frames and the lightbox controls, and the word between the two counter numbers.
classNamestring–Extra classes merged onto the section.
ts
type Ratio = "16:9" | "4:3" | "3:4" | "4:5" | "1:1";

type Photo = {
  src: string;
  alt: string;
  caption: string;
  ratio: Ratio;
};

type Labels = {
  open?: string;
  close?: string;
  previous?: string;
  next?: string;
  of?: string;
};

Behavior notes

  • The masonry is CSS multi-column (two columns on small screens, three from md) with break-inside-avoid on each frame, so every photograph keeps its exact ratio and the columns settle to whatever heights the photos add up to.
  • Each frame is gated on its own load event (or complete for cached files) and on scrolling into view, then opens with a top-to-bottom clip over 1.6 s while the image settles from 1.18 to 1.12 scale; frames are staggered by 0.08 s across the three columns and each drifts from -6% to 6% against the page scroll.
  • Opening the lightbox locks document.body overflow, moves focus to the dialog and restores both when it closes; Escape closes, ArrowLeft and ArrowRight step through with wrap-around, and the counter, image and caption cross-fade with AnimatePresence mode="wait".
  • The lightbox is a bg-foreground surface: the counter sits at text-background/70, the hairline over the caption row is bg-background/20 and draws in from the left, and the close, previous and next controls are button25 pills in the outline tone.
  • With prefers-reduced-motion the frames render open at their final scale, the parallax is zero and the lightbox transitions are plain fades without the horizontal nudge.

More Real Estate blocks

View all Real Estate
PRO

realestate19

Four Materials Columns

PRO

realestate69

Sales Progress Photo Cards

PRO

realestate85

Virtual Tour Frame

Get Pro