AnimationsProNew

Horizontal Scroll Gallery

The section pins to the screen and normal scrolling moves a row of cards sideways. The card in view lights up and a progress bar fills at the bottom.

Customize

color
accentColor
highlightColor
trackColor

Based on Framer Horizontal Scroll (MIT license) · Terms of use

Props

12 properties
PropertyTypeDefaultDescription
childrenReactNode—Slides in one row.
containerRefObject<HTMLElement | null>—Scrolling element when the effect lives inside one. Without it the page scroll is used.
heightstring"100vh"Height of the pinned area, any CSS length.
lengthnumber3How many screen heights of scroll the whole ride takes.
gapnumber24Space between slides in pixels.
showProgressbooleantrueThin progress bar at the bottom.
focusEffectbooleantrueSlides not fully in view fade, turn grey and shrink a little.
colorstring"#ffffff"Main colour: the progress bar. Slides read it as var(--gallery-c1).
accentColorstring"#737373"Second colour. Slides read it as var(--gallery-c2).
highlightColorstring"#e5e5e5"Light highlight colour. Slides read it as var(--gallery-c3).
trackColorstring"rgba(255, 255, 255, 0.1)"Colour of the empty track under the progress bar.
classNamestring—Extra classes.

Dependencies

3 required packages

npm install motion clsx tailwind-merge

Related components

View all