pulkitxm

Horizontal Scroll Gallery

Cards 32

About

Pinned section where vertical scrolling drives a horizontal gallery's position, translating a track of items sideways as you scroll down.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Horizontal Scroll Gallery to your project and fits it to your theme.

Code

How Horizontal Scroll Gallery is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

"use client";

import { HorizontalScrollGallery } from "@/components/ui/horizontal-scroll-gallery";
import { useRef } from "react";

export default function HorizontalScrollGalleryDemo() {
  const containerRef = useRef<HTMLDivElement>(null);
  return (
    <div
      ref={containerRef}
      className="h-72 w-full overflow-y-auto rounded-lg border border-border bg-background"
    >
      <HorizontalScrollGallery scroller={containerRef} scrollHeight="400%">
        {[1, 2, 3, 4, 5, 6, 7, 8].map((i) => (
          <div
            key={i}
            className="flex h-40 w-56 shrink-0 items-center justify-center rounded-lg border border-border bg-muted text-2xl font-bold text-foreground"
          >
            {i}
          </div>
        ))}
      </HorizontalScrollGallery>
    </div>
  );
}

More by pulkitxm

View all
  • Handwriting SVG

    Handwriting SVG

    429
  • Aurora Background

    Aurora Background

    151
  • Party Popper

    Party Popper

    50
  • Scroll-Linked Video Scrubber

    Scroll-Linked Video Scrubber

    34
  • Fluid Cursor Trail

    Fluid Cursor Trail

    32
  • Cursor Spotlight

    Cursor Spotlight

    29
  • Not Found Page

    Not Found Page

    15
  • Infinite Circular Scroll

    Infinite Circular Scroll

    8

More in Cards

View all
  • Statistics Card 2

    Statistics Card 2

    264
  • Course Design Cards

    Course Design Cards

    1.1K
  • Card

    Card

    70
  • Stats cards with links

    Stats cards with links

    39
  • The Item one

    The Item one

    3
  • Card Studio

    Card Studio

    7
  • Statistics Card 7

    Statistics Card 7

    292
  • Item

    Item

    10