Hover Reveal Gallery

A hover-driven gallery where titles reveal floating images anchored to the hovered text, with parallax mouse tracking and optional sound.

obsidian
reverie
meridian
cipher
lumen

Examples

With Sound

Enable the enableSound prop to play a subtle tone on each title hover.

Fauna
Solstice
Drift
Bloom
Haze

Pass an href on each item to make titles navigate on click.

Custom Rotations, Nudges & Sizes

Each item accepts per-image rotations, nudges and sizes to give every project a unique image layout.

Sable
Verso
Glyph
Fract
Monolith

Installation

$ npx shadcn@latest add https://akshitr.com/r/hover-reveal-gallery.json

Usage

import HoverRevealGallery from "@/components/hover-reveal-gallery";
 
const projects = [
  {
    id: "obsidian",
    title: "obsidian",
    images: [
      "https://images.unsplash.com/photo-1558618666-fcd25c85cd64?w=400",
      "https://images.unsplash.com/photo-1507525428034-b723cf961d3e?w=400",
      "https://images.unsplash.com/photo-1541701494587-cb58502866ab?w=400",
    ],
    rotations: [-10, 6, -3],
    nudges: [
      { x: 0, y: 0 },
      { x: 20, y: -10 },
      { x: 0, y: 0 },
    ],
  },
];
 
export default function HoverRevealGalleryDemo() {
  return <HoverRevealGallery items={projects} enableSound />;
}

Component API

HoverRevealGallery

PropTypeDefaultDescription
itemsGalleryItem[]List of projects to display.
enableSound?booleanfalsePlays a subtle sine tone on each title hover.
className?stringClass applied to the root <section> element.

GalleryItem

PropTypeDefaultDescription
idstringUnique identifier for the item.
titlestringDisplay text rendered as the hover target.
imagesstring[]Array of exactly 3 image URLs, one per slot.
href?stringIf provided, the title renders as an <a> tag linking to this URL.
rotations?[number, number, number][0, 0, 0]Per-image rotation in degrees. Animates between projects on hover change.
nudges?[{x,y}, {x,y}, {x,y}][{x:0,y:0},{x:0,y:0},{x:0,y:0}]Per-image x/y offset in px added on top of the computed slot position.
sizes?[number, number, number][120, 140, 120]Per-image size in px.