Grid Motion
A 4x7 grid of items that moves with mouse-driven GSAP parallax
Preview
Design
Code
Ship
Iterate
Deploy
Scale
Optimize
Build
Test
Launch
Monitor
Debug
Refactor
Review
Overview
GridMotion renders a rotated 4×7 grid of content cells that shift horizontally based on mouse position. Each row moves at different speeds and alternating directions, creating a dynamic parallax effect powered by GSAP.
Features
- Mouse-driven parallax — rows shift based on cursor position with inertia
- GSAP powered — smooth 60fps animations with
power3.outeasing - Mixed content — supports text, React nodes, or image URLs
- Radial gradient — configurable background gradient overlay
Usage
import GridMotion from '@/components/grid-motion'
<div className="h-[600px]">
<GridMotion
items={['Item 1', 'Item 2', 'https://picsum.photos/300/200']}
gradientColor="#111"
/>
</div>Props
| Prop | Type | Default | Description |
|---|---|---|---|
items | (string | ReactNode)[] | [] | Up to 28 items to display in the grid. Strings starting with http render as background images. |
gradientColor | string | 'black' | Center color of the radial gradient overlay |