Horizontal Drag

Vertical scroll drives a massive horizontal film strip with parallax cards.

Main Features of Horizontal Drag

How to Use Horizontal Drag in Next.js

Installation Guide for Horizontal Drag

Props

Customize the component with these props

PropertyTypeDefaultDescription
images
string[][]Array of image URLs
itemCount
number10Number of items in the strip
backgroundColor
stringbg-[#1a1a1a]Background color of the component
containerHeight
stringh-[500vh]Height of the container
gap
stringgap-20Gap between items
padding
stringpx-20Horizontal padding
itemWidth
stringw-[60vw]Width of each item
itemHeight
stringh-[70vh]Height of each item
imageScale
number1.2Scale of images
imageXRange
[number, number][-50, 50]Image X position range
xRange
[string, string]["0%", "-80%"]Container X position range
numberColor
stringtext-transparentColor of number labels
numberSize
stringtext-6xlSize of number labels
numberStrokeWidth
string2pxStroke width of numbers
numberStrokeColor
stringrgba(255,255,255,0.2)Stroke color of numbers
className
stringAdditional CSS classes

When to Use

Excellent for product galleries, photography portfolios, and modern Next.js commerce sites. Use this React component for a massive, cinematic 'film strip' that slides horizontally across the screen as the user scrolls vertically.

Best Practices

Maintain consistent spacing within your design system by using a clear `gap` between items. Follow React best practices by ensures the `itemWidth` doesn't cut off important image details on mobile. Optimize for performance by using efficient X-axis transforms for the strip movement.

Why This Component Matters in Modern UI Development

Horizontal flow within a vertical scroll provides a refreshing break for the user. This reusable React component gives developers a robust way to implement complex viewport-driven horizontal motion, adding a layer of sophistication to your real-world application architecture.

Frequently Asked Questions

QHow long can the film strip be?

The `itemCount` determines the strip length. It can handle dozens of items, provided they are properly lazy-loaded.

QCan I hide the numbers?

Yes, the `numberColor` can be set to 'transparent' to remove the labels for a cleaner, image-focused look.

QDoes it support drag interactions?

The movement is mapped to scroll, but it can be easily updated with Framer Motion drag props for touch-based exploration.

Horizontal Drag - React Parallax & Scroll Effects | Uilora