Background Boxes, animated React component
An isometric grid drawn on canvas, set at any skew, scale and rotation. The cell under the pointer pops up like a key in one of the hover colours, overshoots and settles, while a ripple nudges the cells around it.
- Free
- Background Effects
- Hover
- Spring
- 3D
Like Background Boxes? 256 more are in Pro.
Pro unlocks all 256 Pro components, every template and block, and everything we release next. Background Boxes stays free.
Play with it
Move the controls and watch it change. Copy code gives you a snippet with only the props you changed.
Props
| Prop | Type | Default | What it does |
|---|---|---|---|
| rows | number | 60 | Number of rows in the grid. |
| cols | number | 60 | Number of columns in the grid. |
| boxWidth | number | 64 | Width of one cell before the transform, in px. |
| boxHeight | number | 32 | Height of one cell before the transform, in px. |
| borderColor | string | — | Grid line colour. Defaults to a hairline that suits the theme. |
| borderWidth | number | 1 | Grid line width in px. |
| showCrosses | boolean | true | Small plus marks at every other intersection. |
| crossColor | string | — | Colour of the plus marks. Defaults to a theme-aware grey. |
| hoverColors | string[] | 7 system colours | Colours a cell can light up in when it pops. |
| skewX | number | -48 | CSS-style skewX of the grid, in degrees. |
| skewY | number | 14 | CSS-style skewY of the grid, in degrees. |
| scale | number | 0.675 | Scale of the grid. |
| rotation | number | 0 | Rotation of the grid, in degrees. |
| translateX | number | 0 | Pans the grid sideways by a percentage of the container width. |
| translateY | number | 0 | Pans the grid vertically by a percentage of the container height. |
| autoplay | boolean | false | Runs a pretend pointer across the grid until someone moves over it. |
| children | ReactNode | — | Content drawn above the grid. |
| className | string | — | Classes for the root (size, background, radius). |
Add it to your project
- 1
Set up your project once
You need a Next.js project with Tailwind CSS and the
@/import alias. In its root folder, run this once. It createscomponents.jsonand thecn()helper insrc/lib/utils.ts:npx shadcn@latest init -d
Starting from nothing? The Quick Start walks through the whole thing.
- 2
Connect the registry
Run this once per project. It writes the Nexus UI entry into
components.jsonfor you:npx shadcn@latest registry add "@nexus-labs=https://www.nexus-ui.com/api/registry/{name}"Type it exactly as shown.
{name}is filled in by the CLI with the component you ask for, so you never replace it.
- 3
Add the component
Run this from your project root. It adds the component, the helpers it imports and its npm packages.
npx shadcn@latest add @nexus-labs/background-boxes
- 4
Check what was added
With a project made as in the Quick Start (a
src/folder), these files land in it:components/background-boxes/background-boxes.tsxindex.ts - 5
Copying by hand? Skip the registry
Instead of steps 2 and 3 you can copy the files yourself, with no registry and no API key. Step 1 still applies, so that
cn()exists. Install the packages:npm install framer-motion
Then show the source and create each file at the path it gives:
- 6
Use it in a page
Installing only adds the files. Import the component in a page and render it. The Usage tab on the preview shows a fuller example with props:
// src/app/page.tsx import { BackgroundBoxes } from "@/components/background-boxes"; export default function Page() { return ( <main> <BackgroundBoxes /> </main> ); }
Like Background Boxes? 256 more are in Pro.
Pro unlocks all 256 Pro components, every template and block, and everything we release next. Background Boxes stays free.
About Background Boxes
Background Boxes renders a grid of individually colored squares that pulse and shift hue on hover. Each box transitions through color values independently, creating a retro-digital grid aesthetic popular with developer tools and AI products. The hover interaction ripples color changes outward from the cursor. Works as a hero background or section fill with content layered above at a higher z-index.
Good for
- Developer tool hero backgrounds
- AI and tech product landing pages
- Retro-digital aesthetic section fills
- Interactive promotional backgrounds