Docs
Installation
A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its button, media-slot dependencies and any missing npm packages, and installs them straight into your project.
npx shadcn add https://staaarter.com/r/wall-scale-viewer.jsonPrefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/gallery/gallery2.tsx instead.
Usage
The file also exports gallery2Demo, 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 { Gallery2, gallery2Demo } from "@/components/blocks/gallery/gallery2"; export default function Page() { return <Gallery2 {...gallery2Demo} />; }
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| heading | string | "Prints, shown to scale" | Section heading. |
| description | string | "Pick a work, then switch sizes to see how it reads on the wall before you order." | Short subheading under the heading. |
| roomImage | MediaSlotImage | none | Backdrop photo of the wall/room shown behind the piece in the viewer. |
| works | WallWork[] | none | Works to list, each with its own image and size options. |
| className | string | none | Extra classes for the outer section element. |
Types
interface WallSizeOption { label: string; widthIn: number; heightIn: number; price?: string; } interface WallWork { id: string; title: string; artist: string; medium?: string; image?: MediaSlotImage; sizes: WallSizeOption[]; }
Behavior notes
- Clicking "View on wall" opens a real client-side viewer; switching size pills updates useState and resizes the piece within the room mockup via inline width/aspect-ratio styles, no page reload.
- The room backdrop and each work's image render through MediaSlot placeholders since no verified real photo fit this specific brief; swap in real photography via the roomImage/image props.
- Per-size pricing is decorative copy only; nothing is added to a cart or checked out.
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.
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.
Counter Scrolling Image Bands
Two full-bleed image tracks scrolling in opposite directions, opening a framed lightbox on click.