Staggered Grid
A stunning scroll-animated grid layout with staggered column animations and expandable bento cards. Perfect for showcasing products, services, or portfolio items with smooth GSAP-powered animations.
Full-Page Component: This component is designed to be used in a full-page scrollable context. The scroll animations require actual scrolling to trigger.
Install using CLI
npx shadcn@latest add "https://vengeance-ui.vercel.app/r/staggered-grid.json"Install Manually
Install dependencies
Add TypeScript types
Add util file
lib/utils.ts
Copy the SmoothScroll component
This component uses Lenis for smooth scrolling which is essential for the scroll animations. Copy it to components/ui/smooth-scroll.tsx
Copy the StaggeredGrid component
Copy the code below and paste it into components/ui/staggered-grid.tsx
Add required CSS
Add these styles to your app/globals.css
Usage
Props
StaggeredGridProps
| Prop Name | Type | Default | Description |
|---|---|---|---|
| images | string[] | - | Array of image URLs to display in the grid cells. |
| bentoItems | BentoItem[] | - | Array of bento items for the expandable cards section. |
| centerText | string | "Halcyon" | Large centered text displayed above the grid with character animation. |
| credits | object | - | Footer credits configuration with 'madeBy' and 'moreDemos' links. |
| className | string | - | Additional CSS classes for the container. |
| showFooter | boolean | true | Whether to show the footer credits section. |
BentoItem
| Prop Name | Type | Default | Description |
|---|---|---|---|
| id | number | string | - | Unique identifier for the bento item. |
| title | string | - | Title displayed in the card footer. |
| subtitle | string | - | Subtitle for the bento item. |
| description | string | - | Description text for the bento item. |
| icon | React.ReactNode | - | Icon component displayed in the card. |
| image | string | - | Background image URL for the expanded card. |
Features
Staggered Column Animation: Grid items animate in with staggered delays based on their column position, creating a wave-like effect from the center outward as you scroll.
Expandable Bento Cards: Interactive cards that expand on hover to reveal full-width images with smooth transitions and text protection gradients.
Scroll-Triggered Animations: All animations are tied to scroll position using GSAP ScrollTrigger for a smooth, performant experience.
Text Character Animation: The centered text animates character-by-character as you scroll, with letters appearing from the center outward.
Grid Icons with Hover Reveal: Each grid cell shows icons (Github, Slack, Twitter) with text reveal on hover.
Dark Mode Optimized: Designed with a dark theme in mind with zinc color palette.
Smooth Scrolling: Uses Lenis for buttery-smooth scroll experience.
GPU Acceleration: Uses will-change and force3D for hardware-accelerated animations.
Responsive Grid: 7-column, 5-row grid layout that maintains aspect ratio.