npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@afiniti/parallax-slider

v2.0.3

Published

React component for parallax slider for videos and images

Downloads

82

Readme

@afiniti/parallax-slider

Description

React slider component for images and videos. It provides option for parallax effects for sliding animations.

Note

This is a work in progress, not ready for production yet. Your feedback would be appreciated, custom features can also be requested.

Requirements

Currently, works only for image urls from graph media cms. Support for other image sources will be added as enhanced feature later on.

Installation

npm i @afiniti/parallax-slider

Features

  • Fullscreen slider
  • Handles both images and videos.
  • Parallax sliding effects
  • Scroll to slide using mouse and trackpad
  • Multiple callbacks for as much customization as possible
  • Memory and performance optimization: pauses automatically if the current browser tab is inactive or if the browser itself is inactive.

Props

| Name | Type | Description | | ------------------- | -------- | -------------------------------------------------------------------------------- | | data | object | Image or video sources in specified format. | | autoplay | bool | Autoplay slider or not. Defaults to true | | iterations | number | Number of iterations in case of autoplay. Defaults to infinite/null | | slideSpeed | number | Duration in milisecond for slide enter/exit animation. Defaults to 1.6 | | scrollToSlide | bool | Change slides on mouse/trackpad scroll. Defaults to false. | | autoplaySpeed | number | Duration in miliseconds for which each slide stays on screen. Defaults to 3000 | | tiltBackground | bool | Tilt effect on hover. Defaults to false | | initialSlideIndex | number | Optional value in pixels if fixed height needs to be added to image elements. |

Methods

| Name | Description | | ---------------------- | ----------------------------------------------------------------------------------- | | pause | Pause the slider if autoplay enabled. slider.pause() | | resume | Resume the slider if autoplay enabled. slider.resume() | | slideTo | Transitions to slide with index provided. slider.slideTo(3) | | isPaused | Returns if the autoplay is paused. slider.isPaused() | | isSliding | Returns if the sliding animation is in progress. slider.isSliding() | | slideNext | Number of iterations in case of autoplay. infinite/null | | currentIndex | Returns index of active slide. slider.currentIndex() | | slidePrevious | Optional value in pixels if fixed height needs to be added to image elements. | | isIterateable | Returns if the slider has completed given iterations. slider.isIterateable() | | updateScrollToSlide | Updates inital prop value given for scrollToSlide prop. slider.isIterateable() | | updateTiltBackground | Updates inital prop value for updateTiltBackground. slider.updateTiltBackground() |

Callbacks

| Name | Description | | ------------------- | -------------------------------------------------------------------------------------------- | | parallaxSliderApi | Returns reference object for Slider API. | | onSlideStart | Called on start of every slide transition onSlideStart(currentIndex, nextIndex, direction) | | onSlideComplete | Called on end of every slide transition onSlideComplete() |

Example Usage

The package can be integrated inside a react component as follows:

import React, { useRef } from 'react';
import ParallaxSlider from '@afiniti/parallax-slider';

const data={
  {title: "Image 1", Picturehandle: "LCcgeYuDSmeZZPu0hWRo"},
  {title: "Image 2", Picturehandle: "LCcgeYuDSmeZZPu0hWRo"},
  {title: "Image 3", Picturehandle: "LCcgeYuDSmeZZPu0hWRo"}
};

const Component = () => {
  const parallaxSliderApi = useRef();

  return (
    <ParallaxSlider
      autoplay
      data={data}
      scrollToSlide
      iterations={2}
      tiltBackground
      initialSlideIndex={0}
      parallaxSliderApi={ref => {
        parallaxSliderApi.current = ref;
      }}
      onSlideStart={(currentIndex, nextIndex, direction) => {}}
    />
  );
};

export default Component;