Platform
VaultVault
  • Free15
  • Navigation19
  • Buttons9
  • Scroll55
  • Text27
  • Sliders & marquees19
  • Gallery & images67
  • Cursor24
  • Page transitions10
  • Loaders2
  • Backgrounds10
  • UI components33
ButtonsPart of ProButtons
IconsPart of ProIcons
  • Interface Essentials144
  • Social Icons69
  • Payment Badges41
SavedPart of ProSaved
Support
DocumentationDocumentation
MCP serverMCP server
SettingsSettings
VaultSliders & marqueesDrag Parallax Slider
Page Turn MenuBrowse all 182Photo Stack Gallery
  • Free15
  • Navigation19
  • Buttons9
  • Scroll55
  • Text27
  • Sliders & marquees19
  • Gallery & images67
  • Cursor24
  • Page transitions10
  • Loaders2
  • Backgrounds10
  • UI components33
  • Interface Essentials144
  • Social Icons69
  • Payment Badges41
Sign inSign in

Start free. The code for 15 components, no card needed.

Get 15 free

Drag Parallax Slider

This one is locked. Become a member to open the code for it and the rest of the Vault.

See plansTry the 15 free ones

What you'll need.

Install

  • gsap
  • Draggable
  • InertiaPlugin

Setup

npm i gsapregisterPlugin(Draggable, InertiaPlugin)

More like this

  • Card
  • Carousel
  • Parallax
  • Infinite loop
  • Draggable

Features.

  • An endless row of tall slides, 3:4 on desktop: three across on desktop, two at 991px and below, one at 479px and below
  • Every photo sits scaled up inside its card (1.3× by default) and drifts against the motion by how far the card is from the middle of the screen, so the pictures look deeper than the cards
  • Drag it, or throw it and it glides onto the nearest slide
  • Arrows, dots and ← / → step it over 0.8s on the house curve; quick presses stack and keep the row moving, and the dots take the short way round
  • Moves on by itself every 5 seconds, with a pause button beside the dots; a tap on the row toggles the pause on touch. It also holds while a mouse is over the row, while anything in it has keyboard focus, during a drag, offscreen and while the tab is hidden
  • Slides fully out of the row can't be reached by Tab, and a change you make is announced to screen readers
  • The active dot stretches into an orange bar
  • Depth, step time and autoplay are options
  • Respects prefers-reduced-motion: dragging and stepping still work, but every move is instant, with no throw, no depth and no autoplay
  • GSAP with Draggable and InertiaPlugin

How to get it right.

Use portrait photos

Cards are 3:4 on desktop (see Mind the height for smaller screens). The photo inside is scaled up for the depth effect, and its drift is clamped so the card never shows past the picture. Export around 900px wide. Keep the subject in the middle: at depth 2 about a quarter of each picture's width is always cropped, shifting from side to side as it drifts.

Six or more slides

The row loops by moving slides from one end to the other. It needs at least one slide more than fit on screen, or you'll see a gap at the right edge: four or more for three across. Six to ten feel endless.

Short tags

Each tag sits over a dark fade at the bottom of its card, at 2em (0.75em at 479px and below). One or two words fit best.

Mind the height

Cards are capped at --pls-max-height (the screen height minus 16em, never under 16em) so the controls, and a heading if you add one, stay on screen, and are 31.25em / 25em tall at the two breakpoints, so they aren't 3:4 there: about 375 × 400px on a phone. On a short laptop screen the cap makes the cards a little wider than 3:4.

The heading is optional

It ships without one. To add one, put <header class="pls_head"> first in the root with a .pls_eyebrow and a .pls_title, or pass title and eyebrow in React.

Variations.

  • Default — depth 2, 0.8s steps, autoplay every 5s
  • Flat — data-au-parallax="0": photos fill their cards with no drift
  • Deep — data-au-parallax="3": photos at 1.45× with more drift
  • Manual only — data-au-autoplay="0" (the pause button hides)
  • Slow glide — data-au-duration="1.4"
  • More or fewer across — set --pls-per-view on .pls_stage (and inside the two breakpoints)
  • Your colours — override the --pls-* variables

Where it fits.

  • Portfolios — a series of photos or illustrations under one heading
  • Product ranges — one tall card per product, tagged by name
  • Editorial and travel — places, dishes or interiors in a row you can flick through
  • Case studies — the image strip between two blocks of text

Frequently asked.

Yes: data-au-autoplay="0", which also hides the pause button. Any value is the number of seconds between steps.

At 479px and below it shows one card at a time, 25em tall, and you swipe sideways; vertical scrolling and pinch stay with the page over the row. Hovering only holds autoplay for a mouse, so on touch a tap on the row toggles the pause, as does the pause button.

Yes. Tab to the row and use ← / →, or Tab to the arrows, dots and pause button. Keys with a modifier stay with the browser. While anything in the slider has keyboard focus, autoplay holds.

Yes. Every slider runs on its own.

Yes: gsap, Draggable and InertiaPlugin, loaded before the script.

Related components.

NewPro

Ink Bloom Slider

Click

Pro

Rotating Ring Timeline

Drag

Pro

Ruler Card Carousel

Drag