Acquisition Year Ledger
Lists a collection's intake year by year, a short summary sitting beside each year's set of acquired works. Opening any work drops into a viewer that scrolls rather than steps: every acquisition is its own full-height snap-scroll section, and a header counter follows whichever section currently fills the screen, driven by a real IntersectionObserver rather than button-stepped state.
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/acquisition-year-ledger.jsonPrefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/gallery/gallery17.tsx instead.
Usage
The file also exports gallery17Demo, 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 { Gallery17, gallery17Demo } from "@/components/blocks/gallery/gallery17"; export default function Page() { return <Gallery17 {...gallery17Demo} />; }
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| eyebrow | string | "Registrar" | Small label above the heading; omitted entirely when unset. |
| heading | string | "Acquisitions Ledger" | Section heading. |
| description | string | "Every work taken into the collection, listed by the year it entered it." | Supporting copy under the heading; omitted entirely when unset. |
| years | AcquisitionYear[] | none | The ledger, one entry per year; each year's `works` are flattened into a single ordered list for the viewer. |
| className | string | undefined | Extra classes for the outer section element. |
Types
interface LedgerWork { title: string; medium?: string; image?: { src: string; alt: string }; } interface AcquisitionYear { year: string; summary: string; works: LedgerWork[]; }
Behavior notes
- The page list is a flat read: every year's `works` are flattened once per render (not stored in state) into a single ordered list, and each work's flattened index is what a click opens the viewer to.
- The viewer's scroll container uses `snap-y snap-mandatory`, and every acquisition renders as its own `h-full snap-start` section - scrolling (mouse wheel, touch, or a scrollbar drag) is the primary way to move between works, there is no prev/next button.
- A real `IntersectionObserver` (rooted at the scroll container, threshold 0.6) is set up in a `useEffect` that only runs while the viewer is open, observing every section and updating `activeIndex` to whichever one is currently intersecting past the threshold - the header counter reads directly from this state, not from scroll-position math.
- Opening the viewer at a specific work is a real DOM side effect, not derived state: a separate `useEffect` calls `scrollIntoView({ behavior: "auto", block: "start" })` on the clicked work's section ref once the viewer mounts, so it opens already scrolled to the right acquisition instead of always starting at the first one.
- Escape closes the viewer via a keydown listener registered in useEffect only while it's open, removed on close.
- The dark ground (bg-black/90) and white text/icon 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 gallery17.demo.tsx file per this repo's client/demo-file-split rule, not in gallery17.tsx itself.
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.