Cover Archive With Lightbox

Covers

Shot in the studio, mostly on the morning the issue went out.

Every issue has its own picture

About this block

Cover Archive With LightboxPRO

A square cover grid that names each picture only on hover and opens it full screen on click, where arrows and the keyboard walk the archive and a link leads into the issue itself.

Gallery26: Cover Archive With Lightbox

A square cover grid that names each picture only on hover and opens it full screen on click, where arrows and the keyboard walk the archive and a link leads into the issue itself.

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/gallery26?email=YOUR_EMAIL&license_key=YOUR_KEY"

Base UI flavor

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

This installs the block to components/beste/block/gallery26.tsx and the badge6 component it uses for the eyebrow (installed to components/beste/component/badge6.tsx).

Quick start

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

tsx
import { Gallery26, gallery26Demo } from "@/components/beste/block/gallery26";

export default function CoversPage() {
  return <Gallery26 {...gallery26Demo} />;
}

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

tsx
import { Gallery26 } from "@/components/beste/block/gallery26";

export default function CoversPage() {
  return (
    <Gallery26
      eyebrow="Covers"
      heading="Every issue has its own picture"
      readLabel="Read this issue"
      closeLabel="Close"
      covers={[
        {
          image: { src: "/covers/042.jpg", alt: "Notes across a table" },
          title: "The quote we lost on purpose",
          issue: "042",
          href: "/letters/042",
        },
      ]}
      note="Shot in the studio, on the morning the issue went out."
    />
  );
}

Props

PropTypeDefaultDescription
eyebrowstring–Badge6 label, sharing a row with the note
headingstring–Section heading under the rule
coversCover[][]Square tiles, four across on desktop
readLabelstring–Link into the issue, inside the lightbox
closeLabelstring–Label on the lightbox close button
notestring–Line beside the eyebrow
classNamestring–Extra classes for the outer section
ts
type Cover = {
  image: CoverImage;
  title: string;
  issue: string;
  href: string;
};

type CoverImage = {
  src: string;
  alt: string;
};

Behavior notes

  • Tiles are buttons rather than links, because a click opens the lightbox. The link into the issue lives inside the lightbox, so the two actions are never confused.
  • The lightbox handles Escape to close and the arrow keys to move, and the listener is bound only while it is open rather than for the life of the page.
  • Opening it locks body scrolling and restores the previous value on close, so the page behind does not drift while the overlay is up.
  • Stepping wraps with a modulo, so the last cover leads back to the first in both directions.
  • The counter reads "n of total" from state, so it stays correct however many covers you pass.
  • Tile captions appear on hover over a scrim. The grid itself shows pictures only, which is the point of a cover archive.

More Gallery blocks

View all Gallery
PRO

gallery29

Plate Grid Lightbox

PRO

gallery2

Lightbox Frame Grid

PRO

gallery3

Filterable Album Grid

Get Pro access