React Background Boxes
Isometric grid that lights up like a retro arcade floor. Build interactive React backgrounds with 15,000 hoverable cells, TypeScript support, and buttery-smooth 60fps performance for Next.js applications with shadcn/ui.
Powered by
Trying to implement interactive grids?
Join our Discord community for help from other developers.
Remember those light-up dance floors from the 80s? This React component brings that energy to your web app. 15,000 interactive cells arranged in an isometric grid, each one lighting up with vibrant colors on hover. No lag, no jank, just pure retro-futuristic vibes.
Interactive isometric grid
Watch cells illuminate as you glide across the grid:
Built for React applications with TypeScript and Next.js. The 3D perspective uses CSS transforms (skewX
, skewY
, and scale
), while Framer Motion handles the color transitions at 60fps. Each cell picks random colors from a curated palette, creating an endless light show.
Installation
npx shadcn@latest add https://www.shadcn.io/registry/background-boxes.json
npx shadcn@latest add https://www.shadcn.io/registry/background-boxes.json
pnpm dlx shadcn@latest add https://www.shadcn.io/registry/background-boxes.json
bunx shadcn@latest add https://www.shadcn.io/registry/background-boxes.json
Usage
import { Boxes } from "@/components/ui/background-boxes";
export default function Hero() {
return (
<div className="relative h-screen">
<Boxes className="absolute inset-0" />
<div className="relative z-20">
<h1>Your content here</h1>
</div>
</div>
);
}
Why most grid backgrounds look flat
Most developers slap a CSS grid on the page and call it a day. No depth, no interaction, no personality. Some try to add hover effects but end up with laggy performance when dealing with thousands of elements.
This React component creates a true isometric view using transform math: skewX(-48deg)
, skewY(14deg)
, and scale(0.675)
. The result? A grid that looks three-dimensional without any 3D libraries. Framer Motion handles the hover states with zero-duration transitions, so even with 15,000 cells, you get instant feedback.
Features
- 15,000 interactive cells in a 150×100 grid
- Isometric 3D perspective using pure CSS transforms
- Nine-color palette with random selection on hover
- 60fps performance via Framer Motion optimizations
- Plus icon markers on grid intersections for structure
- TypeScript support with complete type definitions
- Zero JavaScript overhead for hover detection
- shadcn/ui compatible with Tailwind CSS integration
API Reference
Boxes
Container component that renders the isometric grid.
Prop | Type | Default | Description |
---|---|---|---|
className | string | - | Additional Tailwind CSS classes |
Common gotchas
Performance with other animations: 15,000 cells is a lot. If you have other heavy animations on the page, consider reducing the grid size or disabling on lower-end devices.
Z-index battles: Your content needs relative z-20
or higher. The grid cells use z-10
, and the mask uses z-40
.
Mobile interaction: Touch devices don't have hover. The effect still works with touch-and-drag, but it's not as smooth as mouse hover.
Color accessibility: The random colors might create contrast issues with certain content. Test with your specific use case.
Container height: The component needs explicit height. Use h-screen
or set a specific height value.
You might also like
Explore other animated background components for React applications:
Interactive Grid Pattern
Responsive grid that lights up on hover with customizable patterns
Grid Pattern
Static and animated grid backgrounds with various styles
Flickering Grid
Grid cells that randomly flicker creating ambient animation
Squares Background
Floating square elements with smooth animations
Hexagon Background
Honeycomb pattern with interactive hover effects
Dots Pattern
Minimalist dot grid with gradient effects
Questions developers actually ask
React Background Beams
Flowing energy streams that never repeat the same pattern. Create organic React backgrounds with 50 unique SVG paths, smooth gradient animations, TypeScript support, and zero performance cost for Next.js applications with shadcn/ui.
React Bubble Background
Floating bubbles that follow your mouse like a lava lamp came to life. Build mesmerizing React backgrounds with gooey SVG filters, TypeScript support, and smooth spring physics for Next.js applications with shadcn/ui.