Skip to content

Cube Field

A field of small shaded cubes that rise under the pointer on a spring and settle back, with a slow wave when nobody is moving. Flat isometric or a perspective floor, in your theme.

On this page

Examples

Mode
Density
Speed
Mask
Focus
Colour

Installation

npx knowns-ui@latest add cube-field
For Claude Code, Cursor or Codex: installs it and wires the props to your own data.

Props

children
ReactNode
Content drawn above the background. The root is relative and isolated; size it with className.
density
"low" | "medium" | "high" | number
Default"medium"
How much is drawn. A number is a multiplier from 0.25 to 3.
speed
number
Default1
Motion multiplier, up to 4. 0 holds a still frame.
color
string
Defaultsoft blue
The tint on raised tops: a theme token, a CSS variable or any CSS colour. The faces always come from --foreground and --background.
mask
"radial" | "top" | "bottom" | "edges" | "none"
Default"radial"
Where it stays visible; it fades out elsewhere.
focus
"center" | "band" | "none"
Default"none"
A quiet zone behind your content: the pattern fades out there so body copy stays at AA contrast. Stacks with mask. The demos use "center".
intensity
number
Default1
Overall strength, 0 to 1.5.
paused
boolean
Defaultfalse
Stops the motion. It also stops offscreen, in hidden tabs and with prefers-reduced-motion (a still, composed frame).
className / style
-
On the root.
mode
"isometric" | "perspective"
Default"isometric"
A flat field seen at 30°, or a floor running toward a horizon.
cell
number
Default52
Grid pitch in CSS px; density nudges it.
height
number
Default26
How far a cube rises at a crest, in CSS px.
radius
number
Default170
Reach of the pointer in CSS px, measured on the floor.
wave
boolean
Defaulttrue
A slow travelling swell, so the field is alive without a pointer. Off: it rests until the pointer moves.
glow
number
Default0.6
Strength of the tint on raised tops, 0 to 1.
clear
boolean | { x, y, w, h }
Defaulttrue
Keeps the content readable: no cube sits under the children's text or controls, cleared line by line. A box in fractions for a fixed area, or false. Shared with Dither Field.
Motion
-
Canvas. Each cube height is pre-rendered into a sprite atlas, so a frame is one spring step and one drawImage per cube. It animates only while the wave runs or a cube is still settling, pauses offscreen, and draws one still frame with reduced motion.

When to use

When to use

  • A product or launch hero that should feel tactile: cubes rise under the pointer and a slow wave keeps it alive.
  • A perspective floor under a headline, when a flat grid feels too quiet.

When not to use

  • Behind long text or dense UI: moving shapes pull the eye at reading distance.
  • A flat grid that holds still: use Grid Pattern.

Using with AI

Use Copy page for AI above to give your assistant this page, Copy prompt under the install command to have it installed and wired to your data, or connect the Knowns UI MCP server and just ask:

  • Add the Knowns UI Cube Field to my app and wire it to my own data.
  • I need a product or launch hero that should feel tactile: cubes rise under the pointer and a slow wave keeps it alive. Set that up with the Knowns UI Cube Field.
  • Which Cube Field props do I need for a minimal setup? Show me a short example.

With the server connected, your assistant calls get_component({ name: "cube-field" }) and search_docs({ query: "cube field" }).

Need help?

Stuck on Cube Field, or found something off? We read every message.