Skip to content

pastetaste

Hover Photo Index

SectionsInteractionMedia

A large typographic list where the hovered row comes forward and a tilted photo card snaps to its height, follows the pointer sideways and cross-fades to that row's photo.

Paste it into Claude Code: it installs the component, asks for your brand and content, and places it on the page you name.

Install

Or by hand, in a Next.js project with shadcn set up. It writes components/pastetaste/hover-photo-index.tsx.

npx shadcn@latest add https://pastetaste.com/r/hover-photo-index.json

Prompt

Install the pastetaste component "Hover Photo Index" (hover-photo-index) into this Next.js project and use it.

What it is: A large typographic list where the hovered row comes forward and a tilted photo card snaps to its height, follows the pointer sideways and cross-fades to that row's photo.

Before you place it, ask me (one short message, in my language; "skip" = sensible default): which page and section it goes in, my brand colour (hex), the text, labels or images it should show, and whether I want my logo or my own copy in the demo content. Then:

Steps:
1. If the project has no components.json, run: npx shadcn@latest init -y -d. Then run: npx shadcn@latest add https://pastetaste.com/r/hover-photo-index.json
   (it writes components/pastetaste/hover-photo-index.tsx; install any npm packages it reports).
2. Import it: import { HoverPhotoIndex } from "@/components/pastetaste/hover-photo-index" (check the file for the exact named export).
3. Put it where it fits on the page I name, keep the rest of the page untouched, and pass props for my colours instead of editing the installed file.
4. It does not depend on Tailwind; colours come from CSS variables (--pt-*) or props.
5. It supports prefers-reduced-motion with a still state; do not remove it.

Props (all optional unless the type has no default):
- items: { label: string; meta?: ReactNode; src: string; href?: string; onSelect?: () => void }[] — Rows; href makes a link, onSelect a button.
- defaultActive: number = 0 — Row active before any hover.
- range: [number, number] = [38, 78] — Min and max horizontal centre of the photo, in percent of the list width.
- tilt: number = -7 — Photo card rotation in degrees.
- photoWidth: string = 'clamp(200px, 24vw, 340px)' — Width of the photo card.

Live preview: https://pastetaste.com/c/hover-photo-index
Then run the dev server, check it in the browser at desktop and mobile width, and tell me the page URL.

Props 5

PropTypeDefaultDescription
items{ label: string; meta?: ReactNode; src: string; href?: string; onSelect?: () => void }[]-Rows; href makes a link, onSelect a button.
defaultActivenumber0Row active before any hover.
range[number, number][38, 78]Min and max horizontal centre of the photo, in percent of the list width.
tiltnumber-7Photo card rotation in degrees.
photoWidthstring'clamp(200px, 24vw, 340px)'Width of the photo card.
View all →