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>
);
}