Skip to content

NewMCP server for your coding agent. Set it up ›

Nexus UI
Get Pro

Heat Field, animated React component

  • Pro
  • Background Effects
  • Hover

A field of grey dots that melts into a heat map under the cursor, swelling and blending from yellow through red to violet. Press and hold to leave heat behind that slowly cools.

Props

PropTypeDefaultWhat it does
radius46Spread of the heat around the pointer in px; held heat spreads a little wider.
hint"Move across the dots. Press and hold to leave heat behind."Line under the field. Pass an empty string to hide it.
autoplayfalseAn invisible hand wanders across the field, now and then pressing, until someone points at it.

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 with your API key

    Heat Field is a Pro item, so the CLI has to send your API key. Do this once per project:

    1. Create a key at nexus-ui.com/dashboard/api-key. Copy it straight away: it starts with nxs_ and is shown only once.
    2. In your project root, next to package.json, create a file named .env.local with this line, using your own key:
      NEXUS_API_KEY=nxs_your_key_here
    3. Open components.json and add this entry inside the outermost braces, next to "aliases". Leave {name} and ${NEXUS_API_KEY} exactly as written; the CLI fills them in:
      "registries": {
        "@nexus-labs": {
          "url": "https://www.nexus-ui.com/api/registry/{name}",
          "headers": {
            "Authorization": "Bearer ${NEXUS_API_KEY}"
          }
        }
      }

How Heat Field works

A field of grey dots that turns into a heat map under the cursor. Dots near the hand swell and melt into each other (an SVG goo filter over the hot layer), shading from yellow to violet. Press and hold to leave a hot spot that slowly cools.

The source, the install command and the build prompt come with Pro.

Heat Field questions

How do I install Heat Field?

Run `npx shadcn@latest add @nexus-labs/heat-field`. The registry lists framer-motion as its dependency. Heat Field is a Pro component, so it needs a Pro plan and an API key; key setup is on the CLI docs page (/docs/cli).

How do I change the size of the heat and the hint text?

`radius` sets the spread of heat around the pointer in px and defaults to 46; held heat spreads a little wider. `hint` sets the line under the field, and an empty string hides it.

How do I leave heat behind?

Press and hold while moving over the dots. Held heat stays and cools slowly after release. Without pressing, dots heat up quickly under the pointer and cool once it moves on.

Does it work with touch or the keyboard?

It listens to pointer events, so mouse, touch and pen all work. The field uses `touch-none`, which stops touch scrolling over it. There is no keyboard interaction; it is exposed as a single labelled image.

What is it built with?

Two 2D canvases, one for the grey dots and one for the heat layer, plus an SVG blur and color-matrix filter that makes the dots melt together. There is no WebGL. The heat ramps from yellow through orange and red to violet.