Perspective Grid
A stunning 3D perspective grid with colorful hover effects that responds to mouse movement.
Hover Me
Install using CLI
npx shadcn@latest add "https://vengeance-ui.vercel.app/r/perspective-grid.json"Install Manually
1
Install dependencies
2
Add util file
lib/utils.ts
3
Add styles to global CSS
Add the following styles to your app/globals.css file
4
Copy the source code
Copy the code below and paste it into components/ui/perspective-grid.tsx
Usage
Props
| Prop Name | Type | Default | Description |
|---|---|---|---|
| className | string | - | Additional CSS classes for the grid container. |
| gridSize | number | 40 | Number of tiles per row/column (creates gridSize × gridSize tiles). |
| showOverlay | boolean | true | Whether to show the gradient overlay. |
| fadeRadius | number | 80 | Fade radius percentage for the gradient overlay. |
Features
3D Perspective: Realistic 3D grid with customizable perspective transform
Colorful Hover Effects: Tiles change to vibrant colors (red, cyan, green, yellow) on hover
Dark Mode Support: Seamlessly adapts to light and dark themes
Smooth Transitions: 1500ms transition duration with instant hover response
Gradient Fade: Radial gradient overlay for a polished look
Client-Side Rendering: Uses mounting state to prevent hydration issues