Kinetic UI
Back to Introduction
General

Parallax Slider

A draggable slider with independent image parallax displacement for added depth.

Quick Actions
CLI Installation
npx kinetic-ui-cli@latest add parallax-slider

Installation

npx kinetic-ui-cli@latest add parallax-slider

Anatomy

This component uses Framer Motion's useScroll and useTransform to map the scroll position of the drag container to the horizontal translation of the inner images.

Features

  • Native horizontal scroll snapping on mobile.
  • Draggable on desktop using Framer Motion.
  • Individual image parallax displacement.
  • Seamless loop bounds.

Usage Guide

1. Import the Component

Import the component into your React or Next.js page:

import { ParallaxSlider } from "@/components/creative/parallax-slider";

2. Implementation Example

Render the component and customize its behavior by passing props:

import { ParallaxSlider } from "@/components/creative/parallax-slider";

export default function Example() {
  return (
    <div className="w-full flex items-center justify-center p-8">
      <ParallaxSlider
        images="example"
      />
    </div>
  );
}
Performance Notes
  • Uses CSS hardware acceleration via GPU transform-binds.
  • Damped interpolation minimizes paint-redraw flashes.
  • Tree-shakable import: only compiles elements requested.
Accessibility Notes
  • Full keyboard focus-ring navigation support (`Tab`/`Shift+Tab`).
  • ARIA roles mapped correctly for assistive screen readers.
  • Respects `prefers-reduced-motion` system toggles.