Warp Slider

A smooth, infinite slider with dynamic warp distortion and momentum based scrolling.

Orion

01/10

Installation

pnpm dlx shadcn@latest add https://atlasui.dev/r/warp-slider.json

Usage

import { WarpSlider } from "@/components/warp-slider";

Define your slides array with name and image URL.

const slides = [
  {
    name: "Slide 1",
    img: "/image-url",
  },
  {
    name: "Slide 2",
    img: "/image-url",
  },
];
<WarpSlider slides={slides} />

Examples

Horizontal

Orion

01/10

Update the orientation property in the config object to "horizontal".

<WarpSlider slides={slides} config={{ orientation: "horizontal" }} />

Props / Configuration

PropTypeDefaultRequiredDescription
slides{ name: string; img: string }[]-trueArray of slides
config.orientation"vertical" | "horizontal""vertical"falseOrientation of the slider
config.minHeightnumber1falseMinimum height of each slide (image)
config.maxHeightnumber1.5falseMaximum height of each slide (image)
config.aspectRationumber1.5falseAspect ratio of slides (width / height)
config.gapnumber0.05falseGap between slides
config.smoothingnumber0.05falseGeneral smoothing factor for motion
config.distortionStrengthnumber2.5falseStrength of the warp/distortion effect
config.distortionSmoothingnumber0.1falseSmoothness of distortion transitions
config.momentumFrictionnumber0.95falseFriction applied to momentum
config.momentumThresholdnumber0.001falseMinimum threshold to trigger momentum
config.wheelSpeednumber0.01falseScroll wheel sensitivity
config.wheelMaxnumber150falseMaximum wheel velocity
config.dragSpeednumber0.01falseDrag interaction speed
config.dragMomentumnumber0.01falseMomentum applied after dragging
config.touchSpeednumber0.01falseTouch swipe sensitivity
config.touchMomentumnumber0.1falseMomentum applied after touch interaction