Walkthrough Exhibition Rail
A long-scroll exhibition where every work sits in its own full-panel section. A sticky rail beside the content shows a numbered index that follows whichever work is currently centered in the viewport, and clicking any number scrolls smoothly to that work.
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/walkthrough-exhibition-rail.jsonPrefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/gallery/gallery11.tsx instead.
Usage
The file also exports gallery11Demo, 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 { Gallery11, gallery11Demo } from "@/components/blocks/gallery/gallery11"; export default function Page() { return <Gallery11 {...gallery11Demo} />; }
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| heading | string | "The exhibition" | Heading shown above the rail and content. |
| works | ExhibitionWork[] | none | Works to walk through, one full-panel section each. |
| className | string | none | Extra classes for the outer section element. |
Types
interface ExhibitionWork { id: string; number: string; title: string; artist?: string; description?: string; image?: MediaSlotImage; }
Behavior notes
- The rail's active number is driven by a real IntersectionObserver watching every work section, not scroll-position math; whichever section crosses the 50% visibility threshold becomes the active index.
- Clicking a rail number calls the section's own ref.scrollIntoView({ behavior: "smooth", block: "center" }), a real scroll, not a fake highlight.
- The sticky rail only shows at the lg breakpoint and up; on narrower viewports the heading remains but the rail is hidden, since a persistent side rail doesn't fit a mobile-width panel.
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.