🚀 Big News:Socket Has Acquired Secure Annex.Learn More →
Socket
Book a DemoSign in
Socket

next-360-image-viewer

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

next-360-image-viewer

Display a set of images in a draggable 360 degree viewer.

latest
Source
npmnpm
Version
2.0.2
Version published
Weekly downloads
32
18.52%
Maintainers
1
Weekly downloads
 
Created
Source

Install

npm i next-360-image-viewer
# Or
yarn add next-360-image-viewer
# Or
pnpm i next-360-image-viewer

Compatibility

  • Next.js: 13.0.0 or higher
  • React: 16.8 or higher (including React 19)
  • TypeScript: 5.0 or higher

Examples

Basic Usage

import { NEXT_IMAGE_TURNTABLE } from 'next-360-image-viewer';

const images = [
  'https://via.placeholder.com/1920x1080?text=1',
  'https://via.placeholder.com/1920x1080?text=2',
  'https://via.placeholder.com/1920x1080?text=3',
];

export const VIEWER = () => {
  return (
    <>
      <NEXT_IMAGE_TURNTABLE images={images} />
    </>
  );
};

Autoplay with Controls

import { useRef } from 'react';
import { NEXT_IMAGE_TURNTABLE, type TURNTABLE_REF } from 'next-360-image-viewer';

export const AUTOPLAY_VIEWER = () => {
  const turntableref = useRef<TURNTABLE_REF>(null);

  const HANDLE_START_AUTOPLAY = () => {
    turntableref.current?.START_AUTOPLAY();
  };

  const HANDLE_STOP_AUTOPLAY = () => {
    turntableref.current?.STOP_AUTOPLAY();
  };

  return (
    <div>
      <NEXT_IMAGE_TURNTABLE
        ref={turntableref}
        images={images}
        autoplay={true}
        autoplayspeed={1500}
        autoplaydirection="forward"
        autopauseonhover={true}
      />
      <button onClick={HANDLE_START_AUTOPLAY}>Start Autoplay</button>
      <button onClick={HANDLE_STOP_AUTOPLAY}>Stop Autoplay</button>
    </div>
  );
};

Props

PropsTypeRequiredDefault Value
imagesstring[]✓undefined
initialimageindexnumber0
movementsensitivitynumber20
onloadfunctionundefined
classNamestringundefined
autoplaybooleanfalse
autoplayspeednumber2000
autoplaydirection'forward' | 'backward''forward'
autopauseonhoverbooleantrue

Autoplay Controls

Use a ref to access autoplay control functions:

const turntableref = useRef<TURNTABLE_REF>(null);

// Available methods:
turntableref.current?.START_AUTOPLAY();
turntableref.current?.STOP_AUTOPLAY();
turntableref.current?.PAUSE_AUTOPLAY();
turntableref.current?.RESUME_AUTOPLAY();

// Available state:
turntableref.current?.isautoplayactive; // boolean
turntableref.current?.ispaused; // boolean
turntableref.current?.activeimageindex; // number

Keywords

nextjs

FAQs

Package last updated on 27 Aug 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts