Paired Hang Compare
Works hung two to a bay on staggered cards. Opening a work drops into a single-pane viewer with a Compare toggle: switching it on splits the viewer into two real panes, each keeping its own caption, with a picker row to choose which second work sits alongside the first. Shared prev/next controls advance both panes together.
Docs
Installation
A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its button, badge, media-slot dependencies and any missing npm packages, and installs them straight into your project.
npx shadcn add https://staaarter.com/r/paired-hang-compare.jsonPrefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/gallery/gallery5.tsx instead.
Usage
The file also exports gallery5Demo, 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 { Gallery5, gallery5Demo } from "@/components/blocks/gallery/gallery5"; export default function Page() { return <Gallery5 {...gallery5Demo} />; }
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| heading | string | "Paired Hang" | Section heading above the hang. |
| description | string | "Works hung two to a bay. Open a pair, or bring in a second work of your choosing to compare." | Short supporting copy under the heading. |
| works | HungWork[] | none | The works on display, grouped two per bay in the order passed in. |
| className | string | none | Extra classes for the outer section element. |
Types
type HungWork = { title: string; artist: string; year: string; image: { src: string; alt: string }; };
Behavior notes
- Compare mode is real client state (useState boolean): turning it on renders a second pane and a horizontal picker row of every work, letting you click any thumbnail to swap in the second pane's work via its own state index.
- Prev/next is genuinely shared: with compare mode on, clicking either arrow (or nothing, since there are no arrow-key bindings on this block) advances both the primary work index and the second-pane index together, each pane keeping its own caption in sync with its own work.
- Turning compare mode off collapses back to a single pane; the second work's picked index is preserved so re-enabling compare shows the same pairing.
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.
Dark Room Fade Viewer
Inverted low-light hang that opens into a chromeless viewer, the work fading up like a dimmer lamp.
Counter Scrolling Image Bands
Two full-bleed image tracks scrolling in opposite directions, opening a framed lightbox on click.