Hover Gallery

A flex strip of plates that expand on hover or click, with spring tilt for neighbors. Built with motion. Bundled photos install under components/3d/hover-gallery/images.

Default

Hover or focus a strip to expand it; neighbors tilt in 3D. Demo images ship with the install.

Loading…

Installation

CLI
npx @sonojs/ui@latest add hover-gallery
Also needsnpm i lucide-react motion

Usage

page.tsx
"use client"

import { HoverGallery } from "@/components/3d/hover-gallery"

export default function Page() {
  return (
    <HoverGallery
      itemHeight={420}
      onImageClick={(index, item) => {
        console.log(index, item.title)
      }}
    />
  )
}

Props

PropTypeDefaultDescription
itemsHoverGalleryItem[]bundled demoFull items with url, title, category, description.
imagesstring[]-URL-only list; titles/meta fall back to the demo set.
itemHeightnumber · string420Plate height (px number or CSS length).
gapnumber10Gap between plates in pixels.
perspectivenumber1000CSS perspective for the tilt.
hoverScalenumber1.05Image scale when a plate is active.
transitionDurationnumber0.5Active image scale duration in seconds.
enableKeyboardNavigationbooleantrueArrow keys, Enter/Space, Escape.
autoPlaybooleanfalseCycle the active plate automatically.
autoPlayDelaynumber4000Autoplay interval in ms.
onImageClick(index, item) => void-Fires when a plate is clicked or activated.
onImageHover(index, item) => void-Fires when a plate is hovered.
classNamestring-Classes on the outer wrapper.
styleCSSProperties-Inline styles on the outer wrapper.