Skip to content

NewMCP server for your coding agent. Set it up ›

Nexus UI
Get Pro

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

PropTypeDefaultWhat it does
rows60Number of rows in the grid.
cols60Number of columns in the grid.
boxWidth64Width of one cell before the transform, in px.
boxHeight32Height of one cell before the transform, in px.
borderColor—Grid line colour. Defaults to a hairline that suits the theme.
borderWidth1Grid line width in px.
showCrossestrueSmall plus marks at every other intersection.
crossColor—Colour of the plus marks. Defaults to a theme-aware grey.
hoverColors7 system coloursColours a cell can light up in when it pops.
skewX-48CSS-style skewX of the grid, in degrees.
skewY14CSS-style skewY of the grid, in degrees.
scale0.675Scale of the grid.
rotation0Rotation of the grid, in degrees.
translateX0Pans the grid sideways by a percentage of the container width.
translateY0Pans the grid vertically by a percentage of the container height.
autoplayfalseRuns a pretend pointer across the grid until someone moves over it.
children—Content drawn above the grid.
className—Classes for the root (size, background, radius).

Add it to your project

  1. 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 creates components.json and the cn() helper in src/lib/utils.ts:

    npx shadcn@latest init -d

    Starting from nothing? The Quick Start walks through the whole thing.

  2. 2

    Connect the registry

    Run this once per project. It writes the Nexus UI entry into components.json for 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.

  1. 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
  2. 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.tsx
    index.ts
  3. 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:

  4. 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

Guides