Staaarter

Dark Room Fade Viewer

An inverted, low-light room where staggered frames hang on a dark panel. Opening one drops into a viewer with no chrome at all: the work fades up from black like a lamp on a dimmer, the caption fades in a beat after, and a small dot-rail at the bottom lets you jump straight to any frame in the hang.

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

npx shadcn add https://staaarter.com/r/dark-room-fade-viewer.json

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

Usage

The file also exports gallery6Demo, 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 { Gallery6, gallery6Demo } from "@/components/blocks/gallery/gallery6";

export default function Page() {
  return <Gallery6 {...gallery6Demo} />;
}

Props

PropTypeDefaultDescription
headingstring"Dark Room"Section heading above the hang.
descriptionstring"A low-light hang. Open a frame and it comes up slowly, like a lamp on a dimmer."Short supporting copy under the heading.
framesHungFrame[]noneThe frames on the wall, rendered in the order passed in.
classNamestringnoneExtra classes for the outer section element.

Types

type HungFrame = {
  title: string;
  image: { src: string; alt: string };
};

Behavior notes

  • The dark panel and viewer use only semantic tokens (bg-foreground / text-background), inverted for the low-light effect, they are not literal color classes and still adapt with the site's own light/dark theme.
  • The fade-up is a real CSS opacity transition, not a static image: the image and its caption are remounted (via a React key tied to the active index) on every open or index change, replaying a fade-in animation, with the caption's transition delayed slightly behind the image so it reads as a beat later, exactly like a dimmer settling.
  • The dot rail is real client state, useState holds the active index, and clicking a dot jumps straight to that frame and replays the fade; Escape and the arrow keys also work.
  • The close button is the only chrome shown, kept deliberately subtle (low-opacity icon, no background box) to keep the "no chrome" feel of the brief while still being operable.