New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

image-sequence-animator

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

image-sequence-animator

A React component to animate a sequence of images like a video.

latest
Source
npmnpm
Version
0.1.7
Version published
Weekly downloads
13
-13.33%
Maintainers
1
Weekly downloads
 
Created
Source

Image Sequence Animator

npm version CI Status npm downloads License: MIT

A lightweight React component for animating a sequence of images with playback controls, mimicking a video-like experience. Ideal for product showcases, interactive tutorials, or frame-by-frame animations.

Features

  • Sequential image playback based on a list of URLs.
  • Configurable frame rate.
  • Optional looping.
  • Playback controls: Play/Pause, Speed selection, Previous/Next frame navigation.
  • Image preloading with loading state display.
  • Basic error handling for failed image loads.
  • Keyboard navigation support (Space/k for play/pause, Left/j for previous, Right/l for next).
  • Built with TypeScript.

Installation

npm install image-sequence-animator
# or
yarn add image-sequence-animator
# or
pnpm add image-sequence-animator

Usage

import React from 'react';
import ImageSequenceAnimator, { ImageSequenceAnimatorProps } from 'image-sequence-animator';

const MyComponent = () => {
  // Array of image URLs (replace with your actual image URLs)
  const imageUrls = Array.from(
    { length: 50 }, // Example: 50 frames
    (_, i) => `https://example.com/path/to/your/image_frame_${String(i + 1).padStart(3, '0')}.jpg`
  );

  return (
    <div>
      <h2>My Animation</h2>
      <ImageSequenceAnimator
        imageUrls={imageUrls}
        frameRate={24} // Optional: default is 30
        loop={true} // Optional: default is true
        playbackSpeeds={[0.5, 1, 1.5, 2]} // Optional: default is [0.5, 1, 2]
        showFilename={true} // Optional: default is false
        style={{ border: '1px solid #ccc', maxWidth: '600px', margin: 'auto' }} // Optional styling
      />
    </div>
  );
};

export default MyComponent;

JavaScript Example

import ImageSequenceAnimator from 'image-sequence-animator';

const MyComponent = () => {
  const imageUrls = [
    'https://example.com/frame1.jpg',
    'https://example.com/frame2.jpg',
    'https://example.com/frame3.jpg',
  ];

  return (
    <ImageSequenceAnimator
      imageUrls={imageUrls}
      frameRate={24}
      loop={true}
      style={{ maxWidth: '600px', margin: 'auto' }}
    />
  );
};

Props

PropTypeDefaultDescription
imageUrlsstring[]RequiredArray of image URLs to animate.
frameRatenumber30Desired frame rate in frames per second.
loopbooleantrueWhether the animation should loop back to the start.
playbackSpeedsnumber[][0.5, 1, 2]Array of available playback speed multipliers for controls.
classNamestringundefinedOptional CSS class name for the main container div.
styleReact.CSSPropertiesundefinedOptional inline styles for the main container div.
showFilenamebooleanfalseWhether to display the filename of the current image.

Development

  • Clone the repository.
  • Install dependencies: npm install
  • Start the development server (if applicable, e.g., for a demo page): npm run dev
  • Run tests: npm run test
  • Build the library: npm run build

Contributing

Contributions are welcome! Please refer to CONTRIBUTING.md for guidelines.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Keywords

react

FAQs

Package last updated on 16 Sep 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