Overview Toggle Viewer
A square grid of photos. Clicking any thumbnail opens a full-screen viewer with two states, toggled by a button: a single full frame with caption and prev/next controls, or an in-place small-thumbnail overview grid of the whole set you can click to jump from without closing the viewer.
Docs
Installation
A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its media-slot dependencies and any missing npm packages, and installs them straight into your project.
npx shadcn add https://staaarter.com/r/overview-toggle-viewer.jsonPrefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/gallery/gallery15.tsx instead.
Usage
The file also exports gallery15Demo, the exact props behind the preview above. Spread it to get a working section in one line, then replace it with your own data.
import { Gallery15, gallery15Demo } from "@/components/blocks/gallery/gallery15"; export default function Page() { return <Gallery15 {...gallery15Demo} />; }
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| heading | string | "The full set" | Section heading. |
| description | string | "Browse the grid, or open any frame for a closer look." | Short subheading under the heading. |
| photos | GalleryPhoto[] | none | Photos shown in the grid and the viewer. |
| className | string | none | Extra classes for the outer section element. |
Types
interface GalleryPhoto { id: string; caption?: string; image?: MediaSlotImage; }
Behavior notes
- The Overview/Single view button toggles real useState between the two viewer layouts; the viewer dialog itself stays mounted the whole time, only its internal mode changes.
- Clicking a thumbnail inside the overview grid jumps openIndex to that photo and switches straight back to single view, all without unmounting or closing the viewer.
- The viewer's scrim uses a literal bg-black/90 rather than a semantic token, the one documented exception in this repo's block conventions for a full-screen photo overlay.
More Gallery Blocks
View all →Plan Chest Sheet Stack
Ruled plan-chest drawer index that opens into a real stack viewer with a lift-and-rotate top sheet.
Wall Scale Viewer
Print grid with a wall-mockup viewer that scales the piece as you switch between size options.
Archive Record Cards
Text-first archive index that opens into a real 3D flip card of front image and back registrar notes.
Loupe Surface Studies
Square material/texture studies that open into a viewer with a real draggable magnifying loupe.
Paired Hang Compare
Two-to-a-bay staggered hang whose viewer can split into two real panes to compare a second work.
Dark Room Fade Viewer
Inverted low-light hang that opens into a chromeless viewer, the work fading up like a dimmer lamp.