Waqar H. Syed

Masonry lightbox

Galleries

About

A responsive two-column masonry gallery with modal dialog lightbox, keyboard navigation, and smooth focal frame previews. It is useful in design portfolios, photography journals, and editorial websites to present photo collections.

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

Code

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

Usage.tsx

"use client";

import * as React from "react";
import Component, { type Props, type State } from "@/components/ui/masonry-lightbox";

const settings = { title: "An eye for the in-between." };
export const loopDuration = 6;

// Pure timeline: export frame n by passing n / 60. No timers or network calls.
export function showcase(time: number): State {
  const t = ((time % loopDuration) + loopDuration) % loopDuration;
  return { active: t < 2.4 ? 0 : t < 3.6 ? 1 : 2, open: t >= 1.2 && t < 4.8 };
}

export default function Demo(props: any = {}) {
  const { showcaseTime, ...incoming } = props;
  const merged = { ...settings, ...incoming };
  return (
    <div className="w-full min-h-[460px] flex items-center justify-center p-4 sm:p-6 bg-background">
      <Component
        {...merged}
        state={showcaseTime === undefined ? incoming.state : showcase(showcaseTime)}
        seeking={showcaseTime !== undefined || incoming.seeking}
      />
    </div>
  );
}

More by Waqar H. Syed

View all
  • Build Pipeline

    Build Pipeline

    272
  • Focus City

    Focus City

    199
  • Scroll animated timeline

    Scroll animated timeline

    185
  • Glowing Pricing Tiers

    Glowing Pricing Tiers

    98
  • Thumbnail image viewer

    Thumbnail image viewer

    94
  • Storage District

    Storage District

    84
  • Before after comparison

    Before after comparison

    82
  • Featured Project Hero

    Featured Project Hero

    52

More in Galleries

View all
  • Animated Gallery

    Animated Gallery

    1.5K
  • Editorial Collage Hero

    Editorial Collage Hero

    493
  • Image Gallery

    Image Gallery

    1.4K
  • 3D Gallery Photography

    3D Gallery Photography

    3.4K
  • Folded Card

    Folded Card

    35
  • Elastic Gallery

    Elastic Gallery

    1.1K
  • Img Sphere

    Img Sphere

    2.2K
  • Hero Section 6

    Hero Section 6

    942