Staaarter

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.

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/walkthrough-exhibition-rail.json

Prefer 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

PropTypeDefaultDescription
headingstring"The exhibition"Heading shown above the rail and content.
worksExhibitionWork[]noneWorks to walk through, one full-panel section each.
classNamestringnoneExtra 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.