Staaarter

Wall Scale Viewer

A grid of works, each listed with the sizes it's printed at. Clicking a work opens a viewer that shows the piece hung on a photographed wall, and switching between size pills resizes the piece in place so a buyer can gauge scale before ordering.

By Staaarter Team
Gallery
Docs
Live preview

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.json

Prefer 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

PropTypeDefaultDescription
headingstring"Prints, shown to scale"Section heading.
descriptionstring"Pick a work, then switch sizes to see how it reads on the wall before you order."Short subheading under the heading.
roomImageMediaSlotImagenoneBackdrop photo of the wall/room shown behind the piece in the viewer.
worksWallWork[]noneWorks to list, each with its own image and size options.
classNamestringnoneExtra 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.