Masonry Caption Gallery

(Picture desk)

Everything we photographed this season.

Shot on set, on press and on the shop floor. Nothing here was staged twice, which is why some of it is slightly crooked.

Specimen sheets, first proofRotterdam, March
The building, before we moved inRotterdam
Packaging trial, sixth runBologna, February
Wayfinding, installed overnightRotterdam, April
Calibration bench, day oneOslo, January
Table of rejected weightsStudio, undated
Shelving, hours before openingBologna, February
Ceiling study for the atriumRotterdam, April
Desk, midway through week threeStudio, undated
About this block

Masonry Caption GalleryPRO

Masonry gallery built with CSS columns so images keep their own heights, each captioned with its subject and place, and any frame opening a drawer that slides in from the right while the wall stays visible behind the scrim.

A masonry wall of photographs, each captioned on its own line, with a viewer that slides in from the right as a drawer rather than covering the page. The wall stays visible behind it, so you keep your place.

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://ui.beste.co/r/gallery1?email=YOUR_EMAIL&license_key=YOUR_KEY"

Base UI flavor

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

This installs the block to components/beste/block/gallery1.tsx plus the badge7 eyebrow and button12 pill button it uses.

Quick start

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

tsx
import { Gallery1, gallery1Demo } from "@/components/beste/block/gallery1";

export default function Page() {
  return <Gallery1 {...gallery1Demo} />;
}

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

tsx
import { Gallery1 } from "@/components/beste/block/gallery1";

export default function Page() {
  return (
    <Gallery1
      badge={{ label: "Picture desk" }}
      heading="Everything we photographed this season."
      description="Shot on set, on press and on the shop floor."
      items={[
        {
          src: "/season/specimens.jpg",
          alt: "Printed letterforms as a type specimen",
          caption: "Specimen sheets, first proof",
          meta: "Rotterdam, March",
        },
        {
          src: "/season/facade.jpg",
          alt: "Concrete and timber studio facade",
          caption: "The building, before we moved in",
          meta: "Rotterdam",
        },
      ]}
      button={{ label: "Open the full archive", href: "/archive" }}
      labels={{
        openLabel: "Open this frame",
        closeLabel: "Close the drawer",
        previousLabel: "Previous frame",
        nextLabel: "Next frame",
        counterSeparator: "of",
      }}
    />
  );
}

Props

PropTypeDefaultDescription
badge{ label: string }–Eyebrow label rendered as a Badge7
headingstring–Section heading in the left header column
descriptionstring–Supporting paragraph in the right header column
itemsGalleryItem[][]Photographs on the wall, in order
buttonActionButton–Pill CTA under the wall, rendered as Button12
labelsGallery1Labels{}Fixed strings that are not content: viewer controls and the counter separator
lightboxbooleantrueRender the built-in viewer; set false to leave the frames static
classNamestring–Extra classes for the outer <section>
ts
type GalleryItem = {
  src: string;
  alt: string;
  caption: string;
  meta: string;
};

type ActionButton = {
  label: string;
  href: string;
};

type Gallery1Labels = {
  openLabel?: string;
  closeLabel?: string;
  previousLabel?: string;
  nextLabel?: string;
  counterSeparator?: string;
};

Behavior notes

  • The viewer is a drawer, not an overlay: it slides in from the right over a bg-foreground/50 scrim, so the wall behind stays visible and the reader keeps their position in it.
  • The slide is started inside a requestAnimationFrame after mount, which is what gives the transform a starting point to animate from instead of appearing already open.
  • Setting lightbox={false} disables every frame button and switches the cursor back to default, leaving a plain captioned wall with no viewer attached.
  • Escape closes and the left and right arrows step through, with the index wrapping in both directions, so the end of the wall runs back to the start.
  • The wall is a CSS columns masonry with break-inside-avoid on each figure, so pictures of any height pack without a layout library.
  • Captions live under the picture on one flex-wrap items-baseline line, so a long caption and its place stay on the same baseline and wrap cleanly rather than colliding.
  • The last figure's bottom margin is removed with [&>figure:last-child]:mb-0, so the closing rule above the CTA does not collide with the final caption.
  • Inside the drawer the picture is object-contain in a min-h-0 flex-1 box, so the whole frame is visible whatever its shape and the caption row stays pinned to the bottom.

More Gallery blocks

View all Gallery
PRO

gallery2

Lightbox Frame Grid

PRO

gallery28

Light Masonry

PRO

gallery29

Plate Grid Lightbox

Get Pro access