Skip to content
WANCRAFT

H.913D & Experimental

Isometric Grid

A CSS-3D isometric field of blocks that rise and glow near the pointer — or a bar-chart city.

NewReactCSSTailwindadvanced

Overview

Isometric Grid lays blocks on a rotateX(55deg) rotateZ(45deg) plane with real CSS 3D: every block is a top face and two shaded side faces scaled on Z, so heights animate on the compositor without layout. Blocks near the pointer rise and take the accent colour with a smooth falloff, resolved from the hovered face or by inverting the projection over gaps, all through CSS variables. Pass heights to turn it into an isometric bar chart with axis labels on the ground plane. It is a proper ARIA grid with a roving tabindex: arrow keys raise and label the focused block, and the whole scene scales to fit its container.

01Installation

Method 01 · Registry

CLI verified

Uses the shadcn CLI in a project initialised with shadcn init. Installs the file to components/ui/isometric-grid.tsx and adds its dependencies.

npx shadcn@latest add https://wancraft.my/r/isometric-grid.json

Method 02 · Copy and paste

  1. 1. No extra dependencies — React and Tailwind CSS only.
  2. 2. Copy the source from the Code tab into components/ui/isometric-grid.tsx.
  3. 3. Import it and adjust props.
Dependencies
None
Peer
react ≥ 18, tailwindcss ≥ 4
Added
13 Oct 2026
Updated
—

02Usage

The default configuration. Change properties above to generate a tailored example in the Usage tab.

example.tsx
import { IsometricGrid } from "@/components/ui/isometric-grid";

export function IsometricGridExample() {
  return (
    <div className="relative h-96 w-full">
      <IsometricGrid />
    </div>
  );
}

03Props

PropTypeDefaultDescription
rowsnumber8Rows in proximity mode (1–40).
colsnumber8Columns in proximity mode (1–40).
blockSizenumber40Cell footprint in px before responsive scaling.
gapnumber4Gap between blocks in px.
maxHeightnumber64Proximity: rise height. Data: height of the largest value. In px.
radiusnumber2.5Proximity falloff radius in cells.
colorstring"#FF7448"Highlight / high-value colour.
secondaryColorstring"#B6F3D1"Low-value tint (data) and proximity halo.
heightsnumber[][]—Data mode: one value per cell (rows × cols). Overrides rows and cols.
rowLabelsstring[]—Row names for axis labels and accessible names.
colLabelsstring[]—Column names for axis labels and accessible names.
formatValue(value: number) => string—Formats values in labels and accessible names.
showLabelsbooleantrueGround-plane axis labels (data mode) and the corner readout.
labelstring"Isometric grid"Accessible name of the grid.
...propsHTMLAttributes<HTMLDivElement>—Forwarded to the root, which fills its parent (h-full w-full).

04Features

  • 01Real CSS 3D isometric plane with shaded top and side faces
  • 02Heights via scale3d on Z — compositor-only transitions, no layout
  • 03Pointer proximity with smooth falloff, written as CSS variables
  • 04Data mode: isometric bar-chart city with labels on the ground plane
  • 05ARIA grid with roving tabindex and arrow / Home / End navigation
  • 06Responsive: the scene scales to fit its container
motion · tweeninput · pointerinput · keyboardinput · focus

05Accessibility

  • role="grid" with rows and gridcells; one cell is tabbable and arrow keys move focus (Ctrl+Home/End jump to the corners).
  • Every cell has an accessible name: row and column, plus the formatted value in data mode.
  • The focused block rises and takes the accent colour with a visible focus outline on its top face.
  • Hover-only feedback is mirrored by focus; touch does not trigger proximity, so scrolling is unaffected.
  • prefers-reduced-motion keeps heights static (no rising) and disables transitions; colour feedback remains.

06Limitations

  • Each block is four elements; beyond ~25×25 cells, 3D compositing gets heavy on low-end devices.