Artist Room Index
Groups an exhibition into artist rooms, each pairing a sticky statement column with a grid of that artist's works. Opening any work shows it large alongside a small thumbnail of the next piece in the show, letting a visitor step straight into it without closing the viewer.
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/artist-room-index.jsonPrefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/gallery/gallery9.tsx instead.
Usage
The file also exports gallery9Demo, 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 { Gallery9, gallery9Demo } from "@/components/blocks/gallery/gallery9"; export default function Page() { return <Gallery9 {...gallery9Demo} />; }
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| eyebrow | string | undefined | Small label above the heading; omitted entirely when unset. |
| heading | ReactNode | none | Section heading. |
| description | string | undefined | Supporting copy under the heading. |
| rooms | Gallery9Room[] | none | Exhibition rooms, each with an artist statement and its own works grid. |
| className | string | undefined | Extra classes for the outer section element. |
Types
interface Gallery9Work { title: string; year: string; image?: { src: string; alt: string }; } interface Gallery9Room { room: string; artist: string; statement: string; works: Gallery9Work[]; }
Behavior notes
- Real client-side state: `openIndex` (number | null) tracks which work the viewer is showing, indexed into a flattened list of every room's works built fresh on each render (not stored in state, so it always reflects the current `rooms` prop).
- The viewer supports ArrowLeft/ArrowRight and Escape via a keydown listener registered in useEffect only while a work is open, removed on close/unmount.
- The 'next' thumbnail inside the open viewer is a real button, not decorative: clicking it sets `openIndex` straight to the next work in the flattened list, the same target ArrowRight would move to, so a visitor can step through the whole show without returning to the grid.
- The statement column uses `md:sticky md:top-24` so it stays in view while its room's works grid scrolls past on larger screens; it's a static column on mobile.
- Close button and the next-work thumbnail are real `<button>` elements with descriptive `aria-label`s.
- "use client" component, so its demo props live in the sibling gallery9.demo.tsx file per this repo's client/demo-file-split rule, not in gallery9.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.