Animated React carousels and galleries

Infinite gallery

An endless wall of work that loops seamlessly in every direction. Drag and flick it, scroll to glide, or let it drift; hover a card and its image resolves out of pixels.

Galleries, drag, Motion

Install

npm i clsx motion tailwind-merge && curl -o components/infinite-gallery.tsx https://motion-brew.com/r/infinite-gallery.tsx

One self contained file for React and Tailwind CSS: infinite-gallery.tsx. Or ask your AI agent to add it through the MCP server.

Usage

import { InfiniteGallery } from "@/components/infinite-gallery";

export default function Page() {
  return (
    <InfiniteGallery
      className="h-screen"
      items={[
        { src: "/work/northwind.jpg", title: "Northwind", alt: "Northwind brand book spread", href: "/work/northwind" },
        { src: "/work/tidal-poster.jpg", video: "/work/tidal.mp4", title: "Tidal", href: "/work/tidal" },
        { src: "/work/kiln.jpg", title: "Kiln", href: "/work/kiln" },
      ]}
    />
  );
}

Props

PropTypeDefaultDescription
items{ src; video?; title; alt?; href? }[]sample photosCards to tile endlessly
cardWidthnumber220Card width, px
cardHeightnumber280Card height, px
gapnumber20Space between cards, px
staggerbooleantrueOffset every other column
driftnumber24Idle drift speed, px/s; 0 stops it
momentumnumber0.6How far a flick carries, 0 to 1
depthnumber0.35Edge cards sit smaller than the center, 0 to 1
parallaxnumber0.5Image shift inside each frame, 0 to 1
wheelbooleantrueWheel and trackpad pan the gallery while hovered
stretchnumber0.6Rubbery stretch along the direction of travel, 0 to 1
blurnumber6Strongest directional motion blur while moving, px
introbooleantrueBloom in from the center on first view
pixelatebooleantruePixel resolve on hover
pixelSizenumber12Starting pixel size for the resolve, px
showTitlesbooleantrueTitle pill on hover
newTabbooleanfalseOpen links in a new tab
labelstring"Project gallery"Accessible name
classNamestringSize of the gallery

More galleries

  • Project index: An editorial project index with large photography: hover a project and its image arrives through a pixel, grain, gradient or mirror transition, then open it with one press.
  • Prism carousel: An endless carousel circling through liquid glass lenses at both edges.
  • Tilt carousel: A looping row of photo cards that glides on its own: the middle one faces you while the rest turn away in 3D.
  • Depth carousel: A stack of cards receding into depth with motion blur.

All animated react carousels and galleries