Staaarter

Edition Inspector

Matted edition cards for a print room; opening one drops into a viewer that keeps the whole sheet and its detail crops in one place. Pill controls swap what the large frame shows, the full sheet or one of several detail-crop views, while a side column holds the print's process notes, sheet size, and edition information.

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 media-slot dependencies and any missing npm packages, and installs them straight into your project.

npx shadcn add https://staaarter.com/r/edition-inspector.json

Prefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/gallery/gallery18.tsx instead.

Usage

The file also exports gallery18Demo, 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 { Gallery18, gallery18Demo } from "@/components/blocks/gallery/gallery18";

export default function Page() {
  return <Gallery18 {...gallery18Demo} />;
}

Props

PropTypeDefaultDescription
eyebrowstring"Print Room"Small label above the heading; omitted entirely when unset.
headingstring"Editions"Section heading.
descriptionstring"Open a sheet to inspect its detail crops alongside the full print."Supporting copy under the heading; omitted entirely when unset.
editionsEdition[]noneThe matted edition cards; each has its own sheet image, detail-crop views, and print/edition details.
classNamestringundefinedExtra classes for the outer section element.

Types

interface DetailView {
  label: string;
  image?: { src: string; alt: string };
}

interface Edition {
  title: string;
  year: string;
  sheetImage?: { src: string; alt: string };
  detailViews: DetailView[];
  processNotes: string;
  sheetSize: string;
  editionInfo: string;
}

Behavior notes

  • Real client-side state: `selectedView` (number, -1 means the full sheet, otherwise an index into that edition's `detailViews`) drives which image the large frame shows; the pill row is a genuine toggle group, not decorative tabs, each pill setting `selectedView` and reflecting the current selection via `aria-pressed`.
  • Opening a different edition resets `selectedView` back to -1 inside the same click handler that sets `openIndex` (not in a useEffect), so a viewer always opens on the full sheet rather than carrying over the previous edition's selected crop.
  • Escape closes the viewer via a keydown listener registered in useEffect only while it's open, removed on close.
  • The side column (process notes, sheet size, edition info) is static per edition, read directly from props, it doesn't change when a detail-view pill is selected, only the large frame does.
  • The dark scrim (bg-black/90) and white pill/text chrome in the viewer are the deliberate dark-viewer-surface exception to the semantic-tokens rule used across this gallery category's other full-screen viewers.
  • "use client" component, so its demo props live in the sibling gallery18.demo.tsx file per this repo's client/demo-file-split rule, not in gallery18.tsx itself.