Image Ring

An editorial orbit of framed plates - drag for inertia, snap to the nearest face, step with keys or dots. Depth fade, focus scale, and a light HUD ship on by default. Built with motion.

Default

Drag to orbit, click dots or use arrow keys to step. Front face lifts; sides fall away with depth.

Loading…

Installation

CLI
npx @sonojs/ui@latest add image-ring
Also needsnpm i motion

Usage

page.tsx
"use client"

import { ImageRing } from "@/components/3d/image-ring"

export default function Page() {
  return (
    <div className="h-[560px] w-full">
      <ImageRing
        captions={["Midnight market", "Glass canyon", "Quiet harbour"]}
        autoPlayMs={4200}
      />
    </div>
  )
}

Props

PropTypeDefaultDescription
imagesstring[]bundled ./imagesImage URLs around the ring. Defaults to the shipped `images/` files next to the component.
captionsstring[]-Optional labels aligned with `images` for the HUD.
widthnumber280Face width in pixels. Height follows `aspectRatio`.
aspectRationumber0.75Width ÷ height of each plate (default 3/4).
perspectivenumber1800CSS perspective distance.
imageDistancenumber460Distance of each face from the ring center.
depthFadenumber0.78Opacity floor for the farthest faces.
focusScalenumber1.04Scale lift applied to the front face.
showHudbooleantrueIndex strip + caption under the stage.
showDotsbooleantrueSnap dots for direct face selection.
autoPlayMsnumber0Idle advance interval in ms. `0` disables.
draggablebooleantrueEnable drag and inertia spin.
onIndexChange(index: number) => void-Called when the front face index changes.
initialRotationnumber180Starting rotateY in degrees.
animationDurationnumber1.15Entrance duration in seconds.
staggerDelaynumber0.07Delay between face entrances.
mobileBreakpointnumber768Viewport width that triggers mobile scale.
mobileScaleFactornumber0.82Scale applied on small viewports.
inertiaPowernumber0.85Inertia power after release.
inertiaTimeConstantnumber280Inertia time constant in ms.
inertiaVelocityMultipliernumber18Release velocity multiplier.
containerClassNamestring-Classes on the outer stage.
ringClassNamestring-Classes on the rotating ring.
imageClassNamestring-Classes on each face plate.