Photo Book Spread Viewer
Photographs presented as printed book spreads on a soft panel: two plates share a page with a center rule down the middle. Round controls turn to the next spread, two images at a time, and a bar index below the controls tracks progress through the whole book.
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/photo-book-spread-viewer.jsonPrefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/gallery/gallery8.tsx instead.
Usage
The file also exports gallery8Demo, 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 { Gallery8, gallery8Demo } from "@/components/blocks/gallery/gallery8"; export default function Page() { return <Gallery8 {...gallery8Demo} />; }
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| heading | string | "The book" | Section heading. |
| description | string | "Turn the pages to move through the full set, two plates per spread." | Short subheading under the heading. |
| photos | GalleryPhoto[] | none | Photos to paginate, two per spread. |
| className | string | none | Extra classes for the outer section element. |
Types
interface GalleryPhoto { id: string; caption?: string; image?: MediaSlotImage; }
Behavior notes
- The round prev/next controls are real client-side state: each click moves spreadIndex by two, and the bar index below highlights the current page from that same state, no page reload.
- Prev/next disable at the first and last spread rather than wrapping around, matching how a physical book runs out of pages.
- An odd-numbered photos array leaves the final spread's right plate blank, same as a printed book's inside back cover.
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.